Skip to content

Commit daa5c4d

Browse files
jbrun3tdavem330
authored andcommitted
net: phy: meson-gxl: fix interrupt support
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]>
1 parent 8a3c245 commit daa5c4d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/net/phy/meson-gxl.c

+6
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ static int meson_gxl_ack_interrupt(struct phy_device *phydev)
201201
static int meson_gxl_config_intr(struct phy_device *phydev)
202202
{
203203
u16 val;
204+
int ret;
204205

205206
if (phydev->interrupts == PHY_INTERRUPT_ENABLED) {
206207
val = INTSRC_ANEG_PR
@@ -213,6 +214,11 @@ static int meson_gxl_config_intr(struct phy_device *phydev)
213214
val = 0;
214215
}
215216

217+
/* Ack any pending IRQ */
218+
ret = meson_gxl_ack_interrupt(phydev);
219+
if (ret)
220+
return ret;
221+
216222
return phy_write(phydev, INTSRC_MASK, val);
217223
}
218224

0 commit comments

Comments
 (0)