Commit a6f0168e authored by Jerome Brunet's avatar Jerome Brunet Committed by Greg Kroah-Hartman

net: phy: meson-gxl: fix interrupt support

[ Upstream commit daa5c4d0 ]

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: cf127ff2 ("net: phy: meson-gxl: add interrupt support")
Signed-off-by: default avatarJerome Brunet <jbrunet@baylibre.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 85ef72d8
...@@ -211,6 +211,7 @@ static int meson_gxl_ack_interrupt(struct phy_device *phydev) ...@@ -211,6 +211,7 @@ static int meson_gxl_ack_interrupt(struct phy_device *phydev)
static int meson_gxl_config_intr(struct phy_device *phydev) static int meson_gxl_config_intr(struct phy_device *phydev)
{ {
u16 val; u16 val;
int ret;
if (phydev->interrupts == PHY_INTERRUPT_ENABLED) { if (phydev->interrupts == PHY_INTERRUPT_ENABLED) {
val = INTSRC_ANEG_PR val = INTSRC_ANEG_PR
...@@ -223,6 +224,11 @@ static int meson_gxl_config_intr(struct phy_device *phydev) ...@@ -223,6 +224,11 @@ static int meson_gxl_config_intr(struct phy_device *phydev)
val = 0; val = 0;
} }
/* Ack any pending IRQ */
ret = meson_gxl_ack_interrupt(phydev);
if (ret)
return ret;
return phy_write(phydev, INTSRC_MASK, val); return phy_write(phydev, INTSRC_MASK, val);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment