summaryrefslogtreecommitdiff
path: root/drivers/net/phy
diff options
context:
space:
mode:
authorAndrew Lunn <andrew@lunn.ch>2019-01-11 02:15:21 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-01-31 10:14:33 +0300
commitc9fe9d194d4513d5902a4e79db0092ace010e572 (patch)
treed8d5a5f741ce2e754e398eb71e7f225515b8d779 /drivers/net/phy
parent552cd931b483c8c0bd19fa67fb2453fa942edc32 (diff)
downloadlinux-c9fe9d194d4513d5902a4e79db0092ace010e572.tar.xz
net: phy: marvell: Fix deadlock from wrong locking
[ Upstream commit e0a7328fad9979104f73e19bedca821ef3262ae1 ] m88e1318_set_wol() takes the lock as part of phy_select_page(). Don't take the lock again with phy_read(), use the unlocked __phy_read(). Fixes: 424ca4c55121 ("net: phy: marvell: fix paged access races") Reported-by: Åke Rehnman <ake.rehnman@gmail.com> Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/net/phy')
-rw-r--r--drivers/net/phy/marvell.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c
index b3aa0027c0ff..d71be15c8c69 100644
--- a/drivers/net/phy/marvell.c
+++ b/drivers/net/phy/marvell.c
@@ -1451,7 +1451,7 @@ static int m88e1318_set_wol(struct phy_device *phydev,
* before enabling it if !phy_interrupt_is_valid()
*/
if (!phy_interrupt_is_valid(phydev))
- phy_read(phydev, MII_M1011_IEVENT);
+ __phy_read(phydev, MII_M1011_IEVENT);
/* Enable the WOL interrupt */
err = __phy_modify(phydev, MII_88E1318S_PHY_CSIER, 0,