powerpc: fix logic error in fixup_irqs
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/1 powerpc: fix logic error in fixup_irqs
When SPARSE_IRQ is set, irq_to_desc() can return NULL. While the code here has a check for NULL, it's not really correct. Fix it by separating the check for it.
This fixes CPU hot unplug for me.
---
v2: cc Alastair, sorry
arch/powerpc/kernel/irq.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
arch/powerpc/kernel/irq.c +4 -1
@@ -295,7 +295,10 @@ void fixup_irqs(const struct cpumask *mafor_each_irq (irq) { desc =irq_to_desc (irq); -if (desc && desc->status &IRQ_PER_CPU ) +if (!desc) +continue ; + +if (desc->status &IRQ_PER_CPU )continue ;cpumask_and (mask, desc->affinity, map);
Quoted 4 lines · Johannes Berg
When
SPARSE_IRQis set,irq_to_desc()can return NULL. While the code here has a check for NULL, it's not really correct. Fix it by separating the check for it.
Incidentally, there's another quirk in fixup_irqs():
...
alloc_cpumask_var(&mask, GFP_KERNEL);
...
local_irq_enable();
mdelay(1);
local_irq_disable();Either it's called with IRQs disabled, in which case it shouldn't do GFP_KERNEL, or it's called with IRQs enabled, in which case it doesn't need the local_irq_enable(), no?
johannes
PATCH v3 1/1 powerpc: fix logic error in fixup_irqs
In reply to a message not in the archiveWhen SPARSE_IRQ is set, irq_to_desc() can return NULL. While the code here has a check for NULL, it's not really correct. Fix it by separating the check for it.
This fixes CPU hot unplug for me.
---
v2: cc Alastair, sorry
v3: indicate stable versions
arch/powerpc/kernel/irq.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
arch/powerpc/kernel/irq.c +4 -1
@@ -295,7 +295,10 @@ void fixup_irqs(const struct cpumask *mafor_each_irq (irq) { desc =irq_to_desc (irq); -if (desc && desc->status &IRQ_PER_CPU ) +if (!desc) +continue ; + +if (desc->status &IRQ_PER_CPU )continue ;cpumask_and (mask, desc->affinity, map);