net: phy: realtek: move PHY resume delay from MAC to PHY driver
Heiner Kallweit
maintainercover net: phy: realtek: move PHY resume delay from MAC to PHY driver
Internal PHY's from RTL8168h up may not be instantly ready after calling genphy_resume(). So far r8169 network driver adds the needed delay, but better handle this in the PHY driver. The network driver may miss other places where the PHY is resumed.
Heiner Kallweit (2):
net: phy: realtek: add delay to resume path of certain internal PHY's
r8169: remove PHY resume delay that is handled in the PHY driver now
drivers/net/ethernet/realtek/r8169_main.c | 2 -- drivers/net/phy/realtek.c | 15 +++++++++++++-- 2 files changed, 13 insertions(+), 4 deletions(-)
Signature · 1 line
2.26.1
Heiner Kallweit
maintainerPATCH 1/2 net: phy: realtek: add delay to resume path of certain internal PHY's
Internal PHY's from RTL8168h up may not be instantly ready after calling genphy_resume(). So far r8169 network driver adds the needed delay, but better handle this in the PHY driver. The network driver may miss other places where the PHY is resumed.
--- drivers/net/phy/realtek.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-)
drivers/net/phy/realtek.c +13 -2
@@ -11,6 +11,7 @@#include <linux/bitops.h> #include <linux/phy.h> #include <linux/module.h> +#include <linux/delay.h> #define RTL821x_PHYSR 0x11#define RTL821x_PHYSR_DUPLEX BIT(13)
@@ -526,6 +527,16 @@ static int rtl8125_match_phy_device(struct phy_device *phydev)rtlgen_supports_2_5gbps (phydev); } +static int rtlgen_resume (struct phy_device *phydev) +{ +int ret =genphy_resume (phydev); + +/* Internal PHY's from RTL8168h up may not be instantly ready */ +msleep (20 ); + +return ret; +} +static struct phy_driver realtek_drvs[] = { {PHY_ID_MATCH_EXACT (0x00008201 ),
@@ -609,7 +620,7 @@ static struct phy_driver realtek_drvs[] = { .match_phy_device = rtlgen_match_phy_device, .read_status = rtlgen_read_status, .suspend = genphy_suspend, - .resume = genphy_resume, + .resume = rtlgen_resume, .read_page = rtl821x_read_page, .write_page = rtl821x_write_page, .read_mmd = rtlgen_read_mmd,
@@ -621,7 +632,7 @@ static struct phy_driver realtek_drvs[] = { .config_aneg = rtl8125_config_aneg, .read_status = rtl8125_read_status, .suspend = genphy_suspend, - .resume = genphy_resume, + .resume = rtlgen_resume, .read_page = rtl821x_read_page, .write_page = rtl821x_write_page, .read_mmd = rtl8125_read_mmd,
Signature · 1 line
2.26.1
Re: [PATCH net-next 1/2] net: phy: realtek: add delay to resume path of certain internal PHY's
Quoted 6 lines · Heiner Kallweit
Internal PHY's from RTL8168h up may not be instantly ready after calling
genphy_resume(). So far r8169 network driver adds the needed delay, but better handle this in the PHY driver. The network driver may miss other places where the PHY is resumed.Signed-off-by Heiner Kallweit <[email protected]>
Signature · 1 line
Florian
Heiner Kallweit
maintainerPATCH 2/2 r8169: remove PHY resume delay that is handled in the PHY driver now
In reply to Heiner KallweitThe Realtek PHY driver takes care of adding the needed delay now, therefore we can remove the delay here.
--- drivers/net/ethernet/realtek/r8169_main.c | 2 -- 1 file changed, 2 deletions(-)
drivers/net/ethernet/realtek/r8169_main.c +0 -2
@@ -2391,8 +2391,6 @@ static void rtl_pll_power_up(struct rtl8169_private *tp) }phy_resume (tp->phydev); -/* give MAC/PHY some time to resume */ -msleep (20 ); }static void rtl_init_rxcfg (struct rtl8169_private *tp)
Signature · 1 line
2.26.1
Re: [PATCH net-next 2/2] r8169: remove PHY resume delay that is handled in the PHY driver now
Quoted 4 lines · Heiner Kallweit
The Realtek PHY driver takes care of adding the needed delay now, therefore we can remove the delay here.
Signed-off-by Heiner Kallweit <[email protected]>
Signature · 1 line
Florian
David Miller
maintainerFrom: Heiner Kallweit <[email protected]>
Date: Sat, 18 Apr 2020 22:07:48 +0200
Quoted 4 lines
Internal PHY's from RTL8168h up may not be instantly ready after calling
genphy_resume(). So far r8169 network driver adds the needed delay, but better handle this in the PHY driver. The network driver may miss other places where the PHY is resumed.
Series applied, thanks.