Skip to content

Commit

Permalink
net: phy: meson-gxl: fix interrupt support
Browse files Browse the repository at this point in the history
BugLink: https://bugs.launchpad.net/bugs/1823060

[ Upstream commit daa5c4d ]

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: cf127ff ("net: phy: meson-gxl: add interrupt support")
Signed-off-by: Jerome Brunet <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Signed-off-by: Seth Forshee <[email protected]>
  • Loading branch information
jbrun3t authored and Seth Forshee committed Apr 3, 2019
1 parent df25aec commit 920b3b6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/net/phy/meson-gxl.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,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
Expand All @@ -223,6 +224,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);
}

Expand Down

0 comments on commit 920b3b6

Please sign in to comment.