tracing: Drop the nested field from lock_release event
[safe/jmp/linux-2.6] / kernel / irq / numa_migrate.c
index 2f69bee..65d3845 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include <linux/irq.h>
+#include <linux/slab.h>
 #include <linux/module.h>
 #include <linux/random.h>
 #include <linux/interrupt.h>
@@ -42,7 +43,7 @@ static bool init_copy_one_irq_desc(int irq, struct irq_desc *old_desc,
                                "for migration.\n", irq);
                return false;
        }
-       spin_lock_init(&desc->lock);
+       raw_spin_lock_init(&desc->lock);
        desc->node = node;
        lockdep_set_class(&desc->lock, &irq_desc_lock_class);
        init_copy_kstat_irqs(old_desc, desc, node, nr_cpu_ids);
@@ -67,10 +68,10 @@ static struct irq_desc *__real_move_irq_desc(struct irq_desc *old_desc,
 
        irq = old_desc->irq;
 
-       spin_lock_irqsave(&sparse_irq_lock, flags);
+       raw_spin_lock_irqsave(&sparse_irq_lock, flags);
 
        /* We have to check it to avoid races with another CPU */
-       desc = irq_desc_ptrs[irq];
+       desc = irq_to_desc(irq);
 
        if (desc && old_desc != desc)
                goto out_unlock;
@@ -90,8 +91,8 @@ static struct irq_desc *__real_move_irq_desc(struct irq_desc *old_desc,
                goto out_unlock;
        }
 
-       irq_desc_ptrs[irq] = desc;
-       spin_unlock_irqrestore(&sparse_irq_lock, flags);
+       replace_irq_desc(irq, desc);
+       raw_spin_unlock_irqrestore(&sparse_irq_lock, flags);
 
        /* free the old one */
        free_one_irq_desc(old_desc, desc);
@@ -100,15 +101,15 @@ static struct irq_desc *__real_move_irq_desc(struct irq_desc *old_desc,
        return desc;
 
 out_unlock:
-       spin_unlock_irqrestore(&sparse_irq_lock, flags);
+       raw_spin_unlock_irqrestore(&sparse_irq_lock, flags);
 
        return desc;
 }
 
 struct irq_desc *move_irq_desc(struct irq_desc *desc, int node)
 {
-       /* those all static, do move them */
-       if (desc->irq < NR_IRQS_LEGACY)
+       /* those static or target node is -1, do not move them */
+       if (desc->irq < NR_IRQS_LEGACY || node == -1)
                return desc;
 
        if (desc->node != node)