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>, <michael@walle.cc>, <pabeni@redhat.com>,
	Xu Liang <lxu@maxlinear.com>
Subject: [PATCH net-next v3] net: phy: mxl-gpy: fix delay time required by loopback disable function
Date: Wed, 11 Jan 2023 16:22:01 +0800	[thread overview]
Message-ID: <20230111082201.15181-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>
---
v2 changes:
 Update comments.

v3 changes:
 Submit for net-next.

 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:[~2023-01-11  8:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-11  8:22 Xu Liang [this message]
2023-01-11 13:40 ` [PATCH net-next v3] net: phy: mxl-gpy: fix delay time required by loopback disable function Andrew Lunn
2023-01-13  5:30 ` Jakub Kicinski

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=20230111082201.15181-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=michael@walle.cc \
    --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).