* [PATCH net] net: phy: meson-gxl: fix interrupt support
@ 2019-03-14 13:49 Jerome Brunet
2019-03-15 22:34 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Jerome Brunet @ 2019-03-14 13:49 UTC (permalink / raw)
To: Andrew Lunn, Florian Fainelli, Heiner Kallweit, David S. Miller,
Kevin Hilman
Cc: netdev, linux-amlogic, linux-kernel, Jerome Brunet
If an interrupt is already pending when the interrupt is enabled on the
GXL phy, no IRQ will ever be triggered.
The fix is simply to make sure pending IRQs are cleared before setting
up the irq mask.
Fixes: cf127ff20af1 ("net: phy: meson-gxl: add interrupt support")
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
---
drivers/net/phy/meson-gxl.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/net/phy/meson-gxl.c b/drivers/net/phy/meson-gxl.c
index a238388eb1a5..0eec2913c289 100644
--- a/drivers/net/phy/meson-gxl.c
+++ b/drivers/net/phy/meson-gxl.c
@@ -201,6 +201,7 @@ static int meson_gxl_ack_interrupt(struct phy_device *phydev)
static int meson_gxl_config_intr(struct phy_device *phydev)
{
u16 val;
+ int ret;
if (phydev->interrupts == PHY_INTERRUPT_ENABLED) {
val = INTSRC_ANEG_PR
@@ -213,6 +214,11 @@ static int meson_gxl_config_intr(struct phy_device *phydev)
val = 0;
}
+ /* Ack any pending IRQ */
+ ret = meson_gxl_ack_interrupt(phydev);
+ if (ret)
+ return ret;
+
return phy_write(phydev, INTSRC_MASK, val);
}
--
2.20.1
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH net] net: phy: meson-gxl: fix interrupt support
2019-03-14 13:49 [PATCH net] net: phy: meson-gxl: fix interrupt support Jerome Brunet
@ 2019-03-15 22:34 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2019-03-15 22:34 UTC (permalink / raw)
To: jbrunet
Cc: andrew, f.fainelli, netdev, linux-kernel, khilman, linux-amlogic,
hkallweit1
From: Jerome Brunet <jbrunet@baylibre.com>
Date: Thu, 14 Mar 2019 14:49:45 +0100
> If an interrupt is already pending when the interrupt is enabled on the
> GXL phy, no IRQ will ever be triggered.
>
> The fix is simply to make sure pending IRQs are cleared before setting
> up the irq mask.
>
> Fixes: cf127ff20af1 ("net: phy: meson-gxl: add interrupt support")
> Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Looks good, applied and queued up for -stable.
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-03-15 22:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-14 13:49 [PATCH net] net: phy: meson-gxl: fix interrupt support Jerome Brunet
2019-03-15 22:34 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®