Skip to contentSkip to conversation

cbus-retu: Fix nested IRQ handling

PATCH In review Michael Buesch 2 participants 3 messages Feb 27, 2011 – Feb 28, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cbus-retu: Fix nested IRQ handling

handle_nested_irq() expects a global IRQ number, so the irq_base has to be added to the RETU irq number.

---

drivers/cbus/retu.c +1 -1
Index: linux-omap-2.6/drivers/cbus/retu.c
===================================================================
@@ -205,7 +205,7 @@ static irqreturn_t retu_irq_handler(int
 		return IRQ_NONE;
 	}
 
-	for (i = 0; idr != 0; i++, idr >>= 1) {
+	for (i = retu->irq_base; idr != 0; i++, idr >>= 1) {
 		if (!(idr & 1))
 			continue;
 
#1 lore raw
Quoted 4 lines · Michael Buesch

handle_nested_irq() expects a global IRQ number, so the irq_base has to be added to the RETU irq number.

Good catch, while at that, could you also cook another patch to add locking on retu_irq_handler ? We are using the internal lockless version of the read/write functions, so we need to hold the mutex before reading/writing to avoid problems.

Signature · 1 line
balbi
#2 lore raw
Quoted 10 lines · Felipe Balbi
Quoted 4 lines · Michael Buesch

handle_nested_irq() expects a global IRQ number, so the irq_base has to be added to the RETU irq number.

Good catch, while at that, could you also cook another patch to add locking on retu_irq_handler ? We are using the internal lockless version of the read/write functions, so we need to hold the mutex before reading/writing to avoid problems.

Ok, it probably is safe without locking (due to the reads being atomic), but I agree that it's more robust to add some locking here. I'll send a patch.

Signature · 1 line
Greetings Michael.