sh: Fixes some write posting issues in the interrupt handling for SH
[deliverable/linux.git] / arch / sh / kernel / cpu / irq / ipr.c
index 3eb17ee5540e88d5c7bd99ae133d597af9e049de..c1508a90fc6af2049946e31de8c98a764b009863 100644 (file)
@@ -21,6 +21,7 @@
 #include <linux/module.h>
 #include <linux/io.h>
 #include <linux/interrupt.h>
+#include <linux/topology.h>
 
 static inline struct ipr_desc *get_ipr_desc(unsigned int irq)
 {
@@ -34,6 +35,7 @@ static void disable_ipr_irq(unsigned int irq)
        unsigned long addr = get_ipr_desc(irq)->ipr_offsets[p->ipr_idx];
        /* Set the priority in IPR to 0 */
        __raw_writew(__raw_readw(addr) & (0xffff ^ (0xf << p->shift)), addr);
+       (void)__raw_readw(addr);        /* Read back to flush write posting */
 }
 
 static void enable_ipr_irq(unsigned int irq)
@@ -59,10 +61,18 @@ void register_ipr_controller(struct ipr_desc *desc)
 
        for (i = 0; i < desc->nr_irqs; i++) {
                struct ipr_data *p = desc->ipr_data + i;
+               struct irq_desc *irq_desc;
 
                BUG_ON(p->ipr_idx >= desc->nr_offsets);
                BUG_ON(!desc->ipr_offsets[p->ipr_idx]);
 
+               irq_desc = irq_to_desc_alloc_node(p->irq, numa_node_id());
+               if (unlikely(!irq_desc)) {
+                       printk(KERN_INFO "can not get irq_desc for %d\n",
+                              p->irq);
+                       continue;
+               }
+
                disable_irq_nosync(p->irq);
                set_irq_chip_and_handler_name(p->irq, &desc->chip,
                                      handle_level_irq, "level");
This page took 0.024048 seconds and 5 git commands to generate.