]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
powerpc/smp: Document irq enable/disable after migrating IRQs
authorMichael Ellerman <mpe@ellerman.id.au>
Wed, 15 Feb 2017 09:49:54 +0000 (20:49 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 3 May 2017 04:45:38 +0000 (14:45 +1000)
This code was until recently completely undocumented and even now the comment is
not very verbose.

We've already had one patch sent to remove the IRQ enable/disable because it's
"paradoxical and unnecessary". So document it thoroughly to save anyone else
from puzzling over it.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/kernel/smp.c

index b37973f11ce08cc8cfc9906a046fe09055977e5b..1eef9e73e6a3eaebf6997cbd0f872783f0506b61 100644 (file)
@@ -615,7 +615,14 @@ int generic_cpu_disable(void)
        /* Update affinity of all IRQs previously aimed at this CPU */
        irq_migrate_all_off_this_cpu();
 
-       /* Give the CPU time to drain in-flight ones */
+       /*
+        * Depending on the details of the interrupt controller, it's possible
+        * that one of the interrupts we just migrated away from this CPU is
+        * actually already pending on this CPU. If we leave it in that state
+        * the interrupt will never be EOI'ed, and will never fire again. So
+        * temporarily enable interrupts here, to allow any pending interrupt to
+        * be received (and EOI'ed), before we take this CPU offline.
+        */
        local_irq_enable();
        mdelay(1);
        local_irq_disable();