Skip to content

Commit

Permalink
net: phy: realtek: Replace phy functions with non-locked version in r…
Browse files Browse the repository at this point in the history
…tl8211e_config_init()

After calling phy_select_page() and until calling phy_restore_page(),
the mutex 'mdio_lock' is already locked, so the driver should use
non-locked version of phy functions. Or there will be a deadlock with
'mdio_lock'.

This replaces phy functions called from rtl8211e_config_init() to avoid
the deadlock issue.

Fixes: f81dadb ("net: phy: realtek: Add rtl8211e rx/tx delays config")
Signed-off-by: Kunihiko Hayashi <[email protected]>
Reviewed-by: Andrew Lunn <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
khayash1 authored and davem330 committed May 13, 2019
1 parent 5afcd14 commit dffe7d2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/net/phy/realtek.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,12 +217,12 @@ static int rtl8211e_config_init(struct phy_device *phydev)
if (oldpage < 0)
goto err_restore_page;

ret = phy_write(phydev, RTL821x_EXT_PAGE_SELECT, 0xa4);
ret = __phy_write(phydev, RTL821x_EXT_PAGE_SELECT, 0xa4);
if (ret)
goto err_restore_page;

ret = phy_modify(phydev, 0x1c, RTL8211E_TX_DELAY | RTL8211E_RX_DELAY,
val);
ret = __phy_modify(phydev, 0x1c, RTL8211E_TX_DELAY | RTL8211E_RX_DELAY,
val);

err_restore_page:
return phy_restore_page(phydev, oldpage, ret);
Expand Down

0 comments on commit dffe7d2

Please sign in to comment.