* [PATCH] ARM: dts: imx6: RDU2: fix irq type for mv88e6xxx switch
@ 2018-07-19 19:38 Uwe Kleine-König
2018-07-19 19:42 ` Fabio Estevam
2018-07-19 20:53 ` Andrew Lunn
0 siblings, 2 replies; 4+ messages in thread
From: Uwe Kleine-König @ 2018-07-19 19:38 UTC (permalink / raw)
To: linux-arm-kernel
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.
Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
---
Cc: Shawn Guo <shawnguo@kernel.org>
Cc: Andrey Smirnov <andrew.smirnov@gmail.com>
Cc: kernel at pengutronix.de
Cc: Chris Healy <cphealy@gmail.com>
Cc: Andrew Lunn <andrew@lunn.ch>
Cc: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Thomas Gleixner <tglx@linutronix.de>
---
arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi b/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi
index 19a075aee19e..f14df0baf2ab 100644
--- a/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi
@@ -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>;
--
2.18.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] ARM: dts: imx6: RDU2: fix irq type for mv88e6xxx switch
2018-07-19 19:38 [PATCH] ARM: dts: imx6: RDU2: fix irq type for mv88e6xxx switch Uwe Kleine-König
@ 2018-07-19 19:42 ` Fabio Estevam
2018-07-19 20:53 ` Andrew Lunn
1 sibling, 0 replies; 4+ messages in thread
From: Fabio Estevam @ 2018-07-19 19:42 UTC (permalink / raw)
To: linux-arm-kernel
Hi Uwe,
On Thu, Jul 19, 2018 at 4:38 PM, Uwe Kleine-K?nig
<u.kleine-koenig@pengutronix.de> wrote:
> 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.
>
> Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
It would be nice to add a Fixes tag.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] ARM: dts: imx6: RDU2: fix irq type for mv88e6xxx switch
2018-07-19 19:38 [PATCH] ARM: dts: imx6: RDU2: fix irq type for mv88e6xxx switch Uwe Kleine-König
2018-07-19 19:42 ` Fabio Estevam
@ 2018-07-19 20:53 ` Andrew Lunn
2018-07-20 2:51 ` Shawn Guo
1 sibling, 1 reply; 4+ messages in thread
From: Andrew Lunn @ 2018-07-19 20:53 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Jul 19, 2018 at 09:38:23PM +0200, Uwe Kleine-K?nig wrote:
> 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.
>
> Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Fixes: f64992d1a916 ("ARM: dts: imx6: RDU2: Add Switch interrupts")
Andrew
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] ARM: dts: imx6: RDU2: fix irq type for mv88e6xxx switch
2018-07-19 20:53 ` Andrew Lunn
@ 2018-07-20 2:51 ` Shawn Guo
0 siblings, 0 replies; 4+ messages in thread
From: Shawn Guo @ 2018-07-20 2:51 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Jul 19, 2018 at 10:53:58PM +0200, Andrew Lunn wrote:
> On Thu, Jul 19, 2018 at 09:38:23PM +0200, Uwe Kleine-K?nig wrote:
> > 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.
> >
> > Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
>
> Reviewed-by: Andrew Lunn <andrew@lunn.ch>
> Fixes: f64992d1a916 ("ARM: dts: imx6: RDU2: Add Switch interrupts")
Applied with the Fixes tag added, thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-07-20 2:51 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-19 19:38 [PATCH] ARM: dts: imx6: RDU2: fix irq type for mv88e6xxx switch Uwe Kleine-König
2018-07-19 19:42 ` Fabio Estevam
2018-07-19 20:53 ` Andrew Lunn
2018-07-20 2:51 ` Shawn Guo
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).