summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorMichael Ellerman <mpe@ellerman.id.au>2017-02-15 12:49:54 +0300
committerMichael Ellerman <mpe@ellerman.id.au>2017-05-03 07:45:38 +0300
commit687b8f24f14db842c8c3f8cb8b24c9a29b691db8 (patch)
treeaca41a72d7a58354fde7f2bd0dc24f0231fdf44b /arch
parent0cc68bfad45b47167c9d99cf560b505983ebd012 (diff)
downloadlinux-687b8f24f14db842c8c3f8cb8b24c9a29b691db8.tar.xz
powerpc/smp: Document irq enable/disable after migrating IRQs
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>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/kernel/smp.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index b37973f11ce0..1eef9e73e6a3 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -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();