All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next 0/2] net: phy: realtek: move PHY resume delay from MAC to PHY driver
@ 2020-04-18 20:07 Heiner Kallweit
  2020-04-18 20:08 ` [PATCH net-next 1/2] net: phy: realtek: add delay to resume path of certain internal PHY's Heiner Kallweit
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Heiner Kallweit @ 2020-04-18 20:07 UTC (permalink / raw)
  To: Realtek linux nic maintainers, David Miller, Andrew Lunn,
	Florian Fainelli, Russell King - ARM Linux
  Cc: netdev

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(-)

-- 
2.26.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH net-next 1/2] net: phy: realtek: add delay to resume path of certain internal PHY's
  2020-04-18 20:07 [PATCH net-next 0/2] net: phy: realtek: move PHY resume delay from MAC to PHY driver Heiner Kallweit
@ 2020-04-18 20:08 ` Heiner Kallweit
  2020-04-18 21:02   ` Florian Fainelli
  2020-04-18 20:09 ` [PATCH net-next 2/2] r8169: remove PHY resume delay that is handled in the PHY driver now Heiner Kallweit
  2020-04-20 18:12 ` [PATCH net-next 0/2] net: phy: realtek: move PHY resume delay from MAC to PHY driver David Miller
  2 siblings, 1 reply; 6+ messages in thread
From: Heiner Kallweit @ 2020-04-18 20:08 UTC (permalink / raw)
  To: Realtek linux nic maintainers, David Miller, Andrew Lunn,
	Florian Fainelli, Russell King - ARM Linux
  Cc: netdev

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 <hkallweit1@gmail.com>
---
 drivers/net/phy/realtek.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/drivers/net/phy/realtek.c b/drivers/net/phy/realtek.c
index 2d99e9de6..c7229d022 100644
--- a/drivers/net/phy/realtek.c
+++ b/drivers/net/phy/realtek.c
@@ -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,
-- 
2.26.1



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH net-next 2/2] r8169: remove PHY resume delay that is handled in the PHY driver now
  2020-04-18 20:07 [PATCH net-next 0/2] net: phy: realtek: move PHY resume delay from MAC to PHY driver Heiner Kallweit
  2020-04-18 20:08 ` [PATCH net-next 1/2] net: phy: realtek: add delay to resume path of certain internal PHY's Heiner Kallweit
@ 2020-04-18 20:09 ` Heiner Kallweit
  2020-04-18 21:03   ` Florian Fainelli
  2020-04-20 18:12 ` [PATCH net-next 0/2] net: phy: realtek: move PHY resume delay from MAC to PHY driver David Miller
  2 siblings, 1 reply; 6+ messages in thread
From: Heiner Kallweit @ 2020-04-18 20:09 UTC (permalink / raw)
  To: Realtek linux nic maintainers, David Miller, Andrew Lunn,
	Florian Fainelli, Russell King - ARM Linux
  Cc: netdev

The Realtek PHY driver takes care of adding the needed delay now,
therefore we can remove the delay here.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 drivers/net/ethernet/realtek/r8169_main.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c
index bf5bf0597..cac56bd67 100644
--- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -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)
-- 
2.26.1



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH net-next 1/2] net: phy: realtek: add delay to resume path of certain internal PHY's
  2020-04-18 20:08 ` [PATCH net-next 1/2] net: phy: realtek: add delay to resume path of certain internal PHY's Heiner Kallweit
@ 2020-04-18 21:02   ` Florian Fainelli
  0 siblings, 0 replies; 6+ messages in thread
From: Florian Fainelli @ 2020-04-18 21:02 UTC (permalink / raw)
  To: Heiner Kallweit, Realtek linux nic maintainers, David Miller,
	Andrew Lunn, Russell King - ARM Linux
  Cc: netdev



On 4/18/2020 1:08 PM, Heiner Kallweit wrote:
> 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 <hkallweit1@gmail.com>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net-next 2/2] r8169: remove PHY resume delay that is handled in the PHY driver now
  2020-04-18 20:09 ` [PATCH net-next 2/2] r8169: remove PHY resume delay that is handled in the PHY driver now Heiner Kallweit
@ 2020-04-18 21:03   ` Florian Fainelli
  0 siblings, 0 replies; 6+ messages in thread
From: Florian Fainelli @ 2020-04-18 21:03 UTC (permalink / raw)
  To: Heiner Kallweit, Realtek linux nic maintainers, David Miller,
	Andrew Lunn, Russell King - ARM Linux
  Cc: netdev



On 4/18/2020 1:09 PM, Heiner Kallweit wrote:
> The Realtek PHY driver takes care of adding the needed delay now,
> therefore we can remove the delay here.
> 
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net-next 0/2] net: phy: realtek: move PHY resume delay from MAC to PHY driver
  2020-04-18 20:07 [PATCH net-next 0/2] net: phy: realtek: move PHY resume delay from MAC to PHY driver Heiner Kallweit
  2020-04-18 20:08 ` [PATCH net-next 1/2] net: phy: realtek: add delay to resume path of certain internal PHY's Heiner Kallweit
  2020-04-18 20:09 ` [PATCH net-next 2/2] r8169: remove PHY resume delay that is handled in the PHY driver now Heiner Kallweit
@ 2020-04-20 18:12 ` David Miller
  2 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2020-04-20 18:12 UTC (permalink / raw)
  To: hkallweit1; +Cc: nic_swsd, andrew, f.fainelli, linux, netdev

From: Heiner Kallweit <hkallweit1@gmail.com>
Date: Sat, 18 Apr 2020 22:07:48 +0200

> 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.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-04-20 18:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-18 20:07 [PATCH net-next 0/2] net: phy: realtek: move PHY resume delay from MAC to PHY driver Heiner Kallweit
2020-04-18 20:08 ` [PATCH net-next 1/2] net: phy: realtek: add delay to resume path of certain internal PHY's Heiner Kallweit
2020-04-18 21:02   ` Florian Fainelli
2020-04-18 20:09 ` [PATCH net-next 2/2] r8169: remove PHY resume delay that is handled in the PHY driver now Heiner Kallweit
2020-04-18 21:03   ` Florian Fainelli
2020-04-20 18:12 ` [PATCH net-next 0/2] net: phy: realtek: move PHY resume delay from MAC to PHY driver David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.