Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: phy: realtek: Replace phy functions with non-locked version in rtl8211e_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: f81dadbcf7fd ("net: phy: realtek: Add rtl8211e rx/tx delays config")
Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Kunihiko Hayashi and committed by
David S. Miller
dffe7d2e 5afcd14c

+3 -3
+3 -3
drivers/net/phy/realtek.c
··· 217 217 if (oldpage < 0) 218 218 goto err_restore_page; 219 219 220 - ret = phy_write(phydev, RTL821x_EXT_PAGE_SELECT, 0xa4); 220 + ret = __phy_write(phydev, RTL821x_EXT_PAGE_SELECT, 0xa4); 221 221 if (ret) 222 222 goto err_restore_page; 223 223 224 - ret = phy_modify(phydev, 0x1c, RTL8211E_TX_DELAY | RTL8211E_RX_DELAY, 225 - val); 224 + ret = __phy_modify(phydev, 0x1c, RTL8211E_TX_DELAY | RTL8211E_RX_DELAY, 225 + val); 226 226 227 227 err_restore_page: 228 228 return phy_restore_page(phydev, oldpage, ret);