Skip to contentSkip to conversation

-- Bug in "genirq: record trigger type"

Fwd: Re: -tip hangs my G5 during boot Yinghai Lu 1 participant 1 message Oct 21, 2008 IRQ

lore
Share & tools
lore

Yinghai Lu

author
#0 lore raw

-------- Original Message --------
Subject: Re: -tip hangs my G5 during boot
Date: Fri, 10 Oct 2008 11:13:34 -0600
From: Chris Friesen <[email protected]>
To: David Brownell <[email protected]>
CC: Ingo Molnar <[email protected]>, Thomas Gleixner <[email protected]>, Yinghai Lu <[email protected]>, "H. Peter Anvin" <[email protected]>
References: <[email protected]> <[email protected]> <[email protected]> <[email protected]>

Quoted 22 lines · David Brownell
Quoted 10 lines · Ingo Molnar
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

bisection gave the following as the culprit.

commit 0c5d1eb77a8be917b638344a22afe1398236482b
Author: David Brownell <[email protected]>

genirq: record trigger type

a quick review of the patch shows that it's about much more than just recording the trigger type, it also changes the semantics of set_irq_type():

Quoted 3 lines · This is *exactly* what I meant when I
Quoted 3 lines
Quoted 3 lines

Other than that, I suspect something (new or old) depending on either set_irq_type(irq, IRQ_TYPE_NONE) getting to an irq_chip which doesn't treat it as a NOP, or ...

Quoted 7 lines

As noted in my patch comments: as part of recording those flags, it made their semantics in set_irq_type() paths be identical to their semantics in request_irq() paths.

There do seem to be some irq_chip implementations in the arch/powerpc/sysdev (and some Cell support) that treat IRQ_TYPE_NONE as other-than-NOP.

At least in my case, it was nothing so complicated. David's original patch was passing "flags" rather than "type" down to __irq_set_trigger(). If I change it to pass "type" then everything works.

The following patch applies on top of -tip with David's original patch re-applied.

Chris

From: Chris Friesen <[email protected]>
Subject: [PATCH] fix set_irq_type() when recording trigger type

In set_irq_type() we want to pass the type rather than the current interrupt state.

kernel/irq/chip.c +1 -1
index 570d1ea..1c178ae 100644
@@ -132,7 +132,7 @@ int set_irq_type(unsigned int irq, unsigned int type)
 		return 0;
 
 	spin_lock_irqsave(&desc->lock, flags);
-	ret = __irq_set_trigger(desc, irq, flags);
+	ret = __irq_set_trigger(desc, irq, type);
 	spin_unlock_irqrestore(&desc->lock, flags);
 	return ret;
 }