Skip to contentSkip to conversation

net: phy: mxl-gpy: fix delay time required by loopback disable function

PATCH Superseded Xu Liang 3 participants 4 messages Dec 21, 2022 – Dec 27, 2022

Subsystems (4)

v2 of 5 Superseded Latest is v5 →

lore
Share & tools
lore

Xu Liang

author maintainer
#0 lore raw

PATCH v2 1/1 net: phy: mxl-gpy: fix delay time required by loopback disable function

GPY2xx devices need 3 seconds to fully switch out of loopback mode before it can safely re-enter loopback mode.

---
 drivers/net/phy/mxl-gpy.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/phy/mxl-gpy.c +4 -2
index 147d7a5a9b35..b682d7fc477c 100644
@@ -770,9 +770,11 @@ static int gpy_loopback(struct phy_device *phydev, bool enable)
 			 enable ? BMCR_LOOPBACK : 0);
 	if (!ret) {
 		/* It takes some time for PHY device to switch
-		 * into/out-of loopback mode.
+		 * into/out-of loopback mode. It takes 3 seconds
+		 * to fully switch out of loopback mode before
+		 * it can safely re-enter loopback mode.
 		 */
-		msleep(100);
+		msleep(enable ? 100 : 3000);
 	}
 
 	return ret;
Signature · 1 line
2.17.1
#1 lore raw

Hi,

Quoted 2 lines · Xu Liang

GPY2xx devices need 3 seconds to fully switch out of loopback mode before it can safely re-enter loopback mode.

Would it be better to record the time that loopback mode is exited, and then delay an attempt to re-enter loopback mode if it's less than three seconds since we exited?

Thanks.

Signature · 2 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!
author maintainer
#2 lore raw

Thanks & Regards,
Xu Liang

Quoted 11 lines

________________________________________
From: Russell King <[email protected]> on behalf of Russell King (Oracle) <[email protected]>
Sent: Wednesday, December 21, 2022 8:21 PM
To: Liang Xu
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Hauke Mehrtens; Thomas Mohren; Ismail, Mohammad Athari; [email protected]; [email protected]
Subject: Re: [PATCH net v2] net: phy: mxl-gpy: fix delay time required by loopback disable function

This email was sent from outside of MaxLinear.

Hi,

Quoted 7 lines
Quoted 2 lines · Xu Liang

GPY2xx devices need 3 seconds to fully switch out of loopback mode before it can safely re-enter loopback mode.

Would it be better to record the time that loopback mode is exited, and then delay an attempt to re-enter loopback mode if it's less than three seconds since we exited?

Loopback is usually used in self-test or debugging.
So I just made a simple delay to avoid complexity of time recording. Please let me know if you think it's worth to change, then I will update the patch.

Quoted 7 lines

Thanks.

--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/<https://www.armlinux.org.uk/developer/patches>
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

#3 lore raw
In reply to Xu Liang

Hi,

Quoted 4 lines

GPY2xx devices need 3 seconds to fully switch out of loopback mode before it can safely re-enter loopback mode.

Again, no Fixes tag?

Changelog is missing, what has changes since v1? Also it is good practice to CC the ones which made comments on the previous versions.

-michael