netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Xu Liang <lxu@maxlinear.com>
To: <andrew@lunn.ch>, <hkallweit1@gmail.com>,
	<netdev@vger.kernel.org>, <davem@davemloft.net>,
	<kuba@kernel.org>
Cc: <linux@armlinux.org.uk>, <hmehrtens@maxlinear.com>,
	<tmohren@maxlinear.com>, <mohammad.athari.ismail@intel.com>,
	<edumazet@google.com>, <pabeni@redhat.com>,
	Xu Liang <lxu@maxlinear.com>
Subject: [PATCH net v2] net: phy: mxl-gpy: fix delay time required by loopback disable function
Date: Wed, 21 Dec 2022 17:43:58 +0800	[thread overview]
Message-ID: <20221221094358.29639-1-lxu@maxlinear.com> (raw)

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


             reply	other threads:[~2022-12-21  9:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-21  9:43 Xu Liang [this message]
2022-12-21 12:21 ` [PATCH net v2] net: phy: mxl-gpy: fix delay time required by loopback disable function Russell King (Oracle)
2022-12-22  5:23   ` Liang Xu
2022-12-27 10:56 ` Michael Walle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221221094358.29639-1-lxu@maxlinear.com \
    --to=lxu@maxlinear.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=hmehrtens@maxlinear.com \
    --cc=kuba@kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=mohammad.athari.ismail@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=tmohren@maxlinear.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).