* [PATCH net v2] net: phy: mxl-gpy: fix delay time required by loopback disable function
@ 2022-12-21 9:43 Xu Liang
2022-12-21 12:21 ` Russell King (Oracle)
2022-12-27 10:56 ` Michael Walle
0 siblings, 2 replies; 4+ messages in thread
From: Xu Liang @ 2022-12-21 9:43 UTC (permalink / raw)
To: andrew, hkallweit1, netdev, davem, kuba
Cc: linux, hmehrtens, tmohren, mohammad.athari.ismail, edumazet,
pabeni, Xu Liang
GPY2xx devices need 3 seconds to fully switch out of loopback mode
before it can safely re-enter loopback mode.
Signed-off-by: Xu Liang <lxu@maxlinear.com>
---
drivers/net/phy/mxl-gpy.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/phy/mxl-gpy.c b/drivers/net/phy/mxl-gpy.c
index 147d7a5a9b35..b682d7fc477c 100644
--- a/drivers/net/phy/mxl-gpy.c
+++ b/drivers/net/phy/mxl-gpy.c
@@ -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;
--
2.17.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net v2] net: phy: mxl-gpy: fix delay time required by loopback disable function
2022-12-21 9:43 [PATCH net v2] net: phy: mxl-gpy: fix delay time required by loopback disable function Xu Liang
@ 2022-12-21 12:21 ` Russell King (Oracle)
2022-12-22 5:23 ` Liang Xu
2022-12-27 10:56 ` Michael Walle
1 sibling, 1 reply; 4+ messages in thread
From: Russell King (Oracle) @ 2022-12-21 12:21 UTC (permalink / raw)
To: Xu Liang
Cc: andrew, hkallweit1, netdev, davem, kuba, hmehrtens, tmohren,
mohammad.athari.ismail, edumazet, pabeni
Hi,
On Wed, Dec 21, 2022 at 05:43:58PM +0800, Xu Liang wrote:
> 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.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net v2] net: phy: mxl-gpy: fix delay time required by loopback disable function
2022-12-21 12:21 ` Russell King (Oracle)
@ 2022-12-22 5:23 ` Liang Xu
0 siblings, 0 replies; 4+ messages in thread
From: Liang Xu @ 2022-12-22 5:23 UTC (permalink / raw)
To: Russell King (Oracle)
Cc: andrew@lunn.ch, hkallweit1@gmail.com, netdev@vger.kernel.org,
davem@davemloft.net, kuba@kernel.org, Hauke Mehrtens,
Thomas Mohren, Ismail, Mohammad Athari, edumazet@google.com,
pabeni@redhat.com, Samuels Xu
Thanks & Regards,
Xu Liang
> ________________________________________
> From: Russell King <linux@armlinux.org.uk> on behalf of Russell King (Oracle) <linux@armlinux.org.uk>
> Sent: Wednesday, December 21, 2022 8:21 PM
> To: Liang Xu
> Cc: andrew@lunn.ch; hkallweit1@gmail.com; netdev@vger.kernel.org; davem@davemloft.net; kuba@kernel.org; Hauke Mehrtens; Thomas Mohren; Ismail, Mohammad Athari; edumazet@google.com; pabeni@redhat.com
> 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,
>
> On Wed, Dec 21, 2022 at 05:43:58PM +0800, Xu Liang wrote:
> > 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.
>
> 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!
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net v2] net: phy: mxl-gpy: fix delay time required by loopback disable function
2022-12-21 9:43 [PATCH net v2] net: phy: mxl-gpy: fix delay time required by loopback disable function Xu Liang
2022-12-21 12:21 ` Russell King (Oracle)
@ 2022-12-27 10:56 ` Michael Walle
1 sibling, 0 replies; 4+ messages in thread
From: Michael Walle @ 2022-12-27 10:56 UTC (permalink / raw)
To: lxu
Cc: andrew, davem, edumazet, hkallweit1, hmehrtens, kuba, linux,
mohammad.athari.ismail, netdev, pabeni, tmohren, Michael Walle
Hi,
> GPY2xx devices need 3 seconds to fully switch out of loopback mode
> before it can safely re-enter loopback mode.
>
> Signed-off-by: Xu Liang <lxu@maxlinear.com>
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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-12-27 10:56 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-21 9:43 [PATCH net v2] net: phy: mxl-gpy: fix delay time required by loopback disable function Xu Liang
2022-12-21 12:21 ` Russell King (Oracle)
2022-12-22 5:23 ` Liang Xu
2022-12-27 10:56 ` Michael Walle
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).