Skip to contentSkip to conversation

kernel: irq: Call irq_chip->irq_mask in irq_disable

PATCH In review Laxman Dewangan 2 participants 2 messages Jul 9, 2013 – Jul 19, 2013 IRQ

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kernel: irq: Call irq_chip->irq_mask in irq_disable

From: sreenivasulu velpula <[email protected]>

If interrupt driver has implemented the irq_mask/irq_unmask callbacks for disable/enable interrupt then call these APIs from irq_disable/irq_enable.

Currently, on irq_disable(), it just look for the callback irq_disable() implemented by chip interrupt driver not the irq_mask().

Add check for the valid callback of irq_mask() and if it is there then call it from irq_disable.

This is based on change done by:
sreenivasulu velpula <[email protected]>

---
 kernel/irq/chip.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
kernel/irq/chip.c +3 -0
index a3bb14f..b6efb92 100644
@@ -232,6 +232,9 @@ void irq_disable(struct irq_desc *desc)
 	if (desc->irq_data.chip->irq_disable) {
 		desc->irq_data.chip->irq_disable(&desc->irq_data);
 		irq_state_set_masked(desc);
+	} else if (desc->irq_data.chip->irq_mask) {
+		desc->irq_data.chip->irq_mask(&desc->irq_data);
+		irq_state_set_masked(desc);
 	}
 }
 
Signature · 1 line
1.7.1.1
#1 lore raw
Quoted 6 lines · Laxman Dewangan

From: sreenivasulu velpula <[email protected]>

If interrupt driver has implemented the irq_mask/irq_unmask callbacks for disable/enable interrupt then call these APIs from irq_disable/irq_enable.

Quoted 6 lines

Currently, on irq_disable(), it just look for the callback irq_disable() implemented by chip interrupt driver not the irq_mask().

Add check for the valid callback of irq_mask() and if it is there then call it from irq_disable.

No. That changes the semantics of lazy irq disable and breaks suspend/resume because we rely on NOT masking interrupts to detect a wakeup.

The irq_disable() merily marks the interrupt disabled and only touches the hardware when the interrupt controller provides an explicit irq_disable() callback.

Thanks,

tglx