* [PATCH 2.6.35 & stable (v2)] powerpc: fix logic error in fixup_irqs
[not found] <1276289669.3918.3.camel@jlt3.sipsolutions.net>
@ 2010-06-11 20:55 ` Johannes Berg
2010-06-11 21:10 ` Johannes Berg
2010-06-16 10:09 ` [PATCH 2.6.35 v3] " Johannes Berg
1 sibling, 1 reply; 3+ messages in thread
From: Johannes Berg @ 2010-06-11 20:55 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev, alastair.bridgewater
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.
Reported-by: Alastair Bridgewater <alastair.bridgewater@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
v2: cc Alastair, sorry
arch/powerpc/kernel/irq.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
--- wireless-testing.orig/arch/powerpc/kernel/irq.c 2010-06-11 22:51:08.000000000 +0200
+++ wireless-testing/arch/powerpc/kernel/irq.c 2010-06-11 22:54:11.000000000 +0200
@@ -295,7 +295,10 @@ void fixup_irqs(const struct cpumask *ma
for_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);
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 2.6.35 & stable (v2)] powerpc: fix logic error in fixup_irqs
2010-06-11 20:55 ` [PATCH 2.6.35 & stable (v2)] powerpc: fix logic error in fixup_irqs Johannes Berg
@ 2010-06-11 21:10 ` Johannes Berg
0 siblings, 0 replies; 3+ messages in thread
From: Johannes Berg @ 2010-06-11 21:10 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev, alastair.bridgewater
On Fri, 2010-06-11 at 22:55 +0200, Johannes Berg wrote:
> 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.
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 2.6.35 v3] powerpc: fix logic error in fixup_irqs
[not found] <1276289669.3918.3.camel@jlt3.sipsolutions.net>
2010-06-11 20:55 ` [PATCH 2.6.35 & stable (v2)] powerpc: fix logic error in fixup_irqs Johannes Berg
@ 2010-06-16 10:09 ` Johannes Berg
1 sibling, 0 replies; 3+ messages in thread
From: Johannes Berg @ 2010-06-16 10:09 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev, alastair.bridgewater
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.
Reported-by: Alastair Bridgewater <alastair.bridgewater@gmail.com>
Cc: stable@kernel.org [2.6.32+]
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
v2: cc Alastair, sorry
v3: indicate stable versions
arch/powerpc/kernel/irq.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
--- wireless-testing.orig/arch/powerpc/kernel/irq.c 2010-06-11 22:51:08.000000000 +0200
+++ wireless-testing/arch/powerpc/kernel/irq.c 2010-06-11 22:54:11.000000000 +0200
@@ -295,7 +295,10 @@ void fixup_irqs(const struct cpumask *ma
for_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);
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-06-16 10:09 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1276289669.3918.3.camel@jlt3.sipsolutions.net>
2010-06-11 20:55 ` [PATCH 2.6.35 & stable (v2)] powerpc: fix logic error in fixup_irqs Johannes Berg
2010-06-11 21:10 ` Johannes Berg
2010-06-16 10:09 ` [PATCH 2.6.35 v3] " Johannes Berg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).