net: phy: marvell: Fix deadlock from wrong locking
authorAndrew Lunn <andrew@lunn.ch>
Thu, 10 Jan 2019 23:15:21 +0000 (00:15 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 16 Jan 2019 05:51:19 +0000 (21:51 -0800)
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>
drivers/net/phy/marvell.c

index 0d6b58d1cdc053b8804c63354582ce7e556214b5..2e12f982534f7f248d3c5be2968b1238eae45137 100644 (file)
@@ -1435,7 +1435,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,