Skip to contentSkip to conversation

ARM: dts: imx6: RDU2: fix irq type for mv88e6xxx switch

PATCH New Uwe Kleine-König 4 participants 4 messages Jul 19, 2018 – Jul 20, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: dts: imx6: RDU2: fix irq type for mv88e6xxx switch

The Marvell switches report their interrupts in a level sensitive way. When using edge sensitive detection a race condition in the interrupt handler of the swich might result in the OS to miss all future events which might make the switch non-functional.

The problem is that both mv88e6xxx_g2_irq_thread_fn() and mv88e6xxx_g1_irq_thread_work() sample the irq cause register (MV88E6XXX_G2_INT_SRC and MV88E6XXX_G1_STS respectively) once and then handle the observed sources. If after sampling but before all observed irq sources are handled a new irq source gets active this is not noticed by the handler which returns unsuspecting, but the interrupt line stays active which prevents the edge detector to kick in.

All device trees but imx6qdl-zii-rdu2 get this right (most of them by not specifying an interrupt parent). So fix imx6qdl-zii-rdu2 accordingly.

---
Cc: Shawn Guo <[email protected]>
Cc: Andrey Smirnov <[email protected]>
Cc: kernel at pengutronix.de
Cc: Chris Healy <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: Vivien Didelot <[email protected]>
Cc: Russell King <[email protected]>
Cc: Thomas Gleixner <[email protected]>

---
 arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi +1 -1
index 19a075aee19e..f14df0baf2ab 100644
@@ -692,7 +692,7 @@
 			dsa,member = <0 0>;
 			eeprom-length = <512>;
 			interrupt-parent = <&gpio6>;
-			interrupts = <3 IRQ_TYPE_EDGE_FALLING>;
+			interrupts = <3 IRQ_TYPE_LEVEL_LOW>;
 			interrupt-controller;
 			#interrupt-cells = <2>;
 
Signature · 1 line
2.18.0
reviewer
#1 lore raw

PATCH 1/1 ARM: dts: imx6: RDU2: fix irq type for mv88e6xxx switch

Hi Uwe,

Quoted 13 lines · Uwe Kleine-K?nig

The Marvell switches report their interrupts in a level sensitive way. When using edge sensitive detection a race condition in the interrupt handler of the swich might result in the OS to miss all future events which might make the switch non-functional.

The problem is that both mv88e6xxx_g2_irq_thread_fn() and mv88e6xxx_g1_irq_thread_work() sample the irq cause register (MV88E6XXX_G2_INT_SRC and MV88E6XXX_G1_STS respectively) once and then handle the observed sources. If after sampling but before all observed irq sources are handled a new irq source gets active this is not noticed by the handler which returns unsuspecting, but the interrupt line stays active which prevents the edge detector to kick in.

Quoted 5 lines

All device trees but imx6qdl-zii-rdu2 get this right (most of them by not specifying an interrupt parent). So fix imx6qdl-zii-rdu2 accordingly.

It would be nice to add a Fixes tag.

#2 lore raw

PATCH 1/1 ARM: dts: imx6: RDU2: fix irq type for mv88e6xxx switch

In reply to Uwe Kleine-König
Quoted 13 lines · Uwe Kleine-K?nig

The Marvell switches report their interrupts in a level sensitive way. When using edge sensitive detection a race condition in the interrupt handler of the swich might result in the OS to miss all future events which might make the switch non-functional.

The problem is that both mv88e6xxx_g2_irq_thread_fn() and mv88e6xxx_g1_irq_thread_work() sample the irq cause register (MV88E6XXX_G2_INT_SRC and MV88E6XXX_G1_STS respectively) once and then handle the observed sources. If after sampling but before all observed irq sources are handled a new irq source gets active this is not noticed by the handler which returns unsuspecting, but the interrupt line stays active which prevents the edge detector to kick in.

Quoted 5 lines

All device trees but imx6qdl-zii-rdu2 get this right (most of them by not specifying an interrupt parent). So fix imx6qdl-zii-rdu2 accordingly.

Fixes f64992d1a916 ("ARM: dts: imx6: RDU2: Add Switch interrupts")

Andrew

#3 lore raw

PATCH 1/1 ARM: dts: imx6: RDU2: fix irq type for mv88e6xxx switch

Quoted 14 lines · Andrew Lunn
Quoted 13 lines · Uwe Kleine-K?nig

The Marvell switches report their interrupts in a level sensitive way. When using edge sensitive detection a race condition in the interrupt handler of the swich might result in the OS to miss all future events which might make the switch non-functional.

The problem is that both mv88e6xxx_g2_irq_thread_fn() and mv88e6xxx_g1_irq_thread_work() sample the irq cause register (MV88E6XXX_G2_INT_SRC and MV88E6XXX_G1_STS respectively) once and then handle the observed sources. If after sampling but before all observed irq sources are handled a new irq source gets active this is not noticed by the handler which returns unsuspecting, but the interrupt line stays active which prevents the edge detector to kick in.

Quoted 8 lines
Quoted 5 lines

All device trees but imx6qdl-zii-rdu2 get this right (most of them by not specifying an interrupt parent). So fix imx6qdl-zii-rdu2 accordingly.

Fixes f64992d1a916 ("ARM: dts: imx6: RDU2: Add Switch interrupts")

Applied with the Fixes tag added, thanks.