Skip to content

Commit b6a930f

Browse files
JingjuHoudavem330
authored andcommitted
net: phy: marvell: clear wol event before setting it
If WOL event happened once, the LED[2] interrupt pin will not be cleared unless we read the CSISR register. If interrupts are in use, the normal interrupt handling will clear the WOL event. Let's clear the WOL event before enabling it if !phy_interrupt_is_valid(). Signed-off-by: Jingju Hou <[email protected]> Signed-off-by: Jisheng Zhang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 77621f0 commit b6a930f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

drivers/net/phy/marvell.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1393,6 +1393,15 @@ static int m88e1318_set_wol(struct phy_device *phydev,
13931393
if (err < 0)
13941394
goto error;
13951395

1396+
/* If WOL event happened once, the LED[2] interrupt pin
1397+
* will not be cleared unless we reading the interrupt status
1398+
* register. If interrupts are in use, the normal interrupt
1399+
* handling will clear the WOL event. Clear the WOL event
1400+
* before enabling it if !phy_interrupt_is_valid()
1401+
*/
1402+
if (!phy_interrupt_is_valid(phydev))
1403+
phy_read(phydev, MII_M1011_IEVENT);
1404+
13961405
/* Enable the WOL interrupt */
13971406
err = __phy_modify(phydev, MII_88E1318S_PHY_CSIER, 0,
13981407
MII_88E1318S_PHY_CSIER_WOL_EIE);

0 commit comments

Comments
 (0)