From: Andrew Lunn <andrew@lunn.ch>
To: Aminuddin Jamaluddin <aminuddin.jamaluddin@intel.com>
Cc: Heiner Kallweit <hkallweit1@gmail.com>,
Russell King <linux@armlinux.org.uk>,
"David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Mohammad Athari Bin Ismail <mohammad.athari.ismail@intel.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org, tee.min.tan@intel.com,
muhammad.husaini.zulkifli@intel.com
Subject: Re: [PATCH net 1/1] net: phy: marvell: add link status check before enabling phy loopback
Date: Thu, 25 Aug 2022 15:26:57 +0200 [thread overview]
Message-ID: <Ywd4oUPEssQ+/OBE@lunn.ch> (raw)
In-Reply-To: <20220825082238.11056-1-aminuddin.jamaluddin@intel.com>
> @@ -2015,14 +2016,23 @@ static int m88e1510_loopback(struct phy_device *phydev, bool enable)
> if (err < 0)
> return err;
>
> - /* FIXME: Based on trial and error test, it seem 1G need to have
> - * delay between soft reset and loopback enablement.
> - */
> - if (phydev->speed == SPEED_1000)
> - msleep(1000);
> + if (phydev->speed == SPEED_1000) {
> + err = phy_read_poll_timeout(phydev, MII_BMSR, val, val & BMSR_LSTATUS,
> + PHY_LOOP_BACK_SLEEP,
> + PHY_LOOP_BACK_TIMEOUT, true);
Is this link with itself?
Have you tested this with the cable unplugged?
> + if (err)
> + return err;
I'm just trying to ensure we don't end up here with -ETIMEDOUT.
>
> +#define PHY_LOOP_BACK_SLEEP 1000000
> +#define PHY_LOOP_BACK_TIMEOUT 8000000
The kernel seems to be pretty consistent in having loopback as one
word.
Andrew
next prev parent reply other threads:[~2022-08-25 13:27 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-25 8:22 [PATCH net 1/1] net: phy: marvell: add link status check before enabling phy loopback Aminuddin Jamaluddin
2022-08-25 13:26 ` Andrew Lunn [this message]
2022-08-30 7:51 ` Jamaluddin, Aminuddin
2022-08-30 12:17 ` Andrew Lunn
2022-09-15 6:57 ` Jamaluddin, Aminuddin
2022-09-19 23:45 ` Andrew Lunn
2022-10-27 4:35 ` Jamaluddin, Aminuddin
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=Ywd4oUPEssQ+/OBE@lunn.ch \
--to=andrew@lunn.ch \
--cc=aminuddin.jamaluddin@intel.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hkallweit1@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=mohammad.athari.ismail@intel.com \
--cc=muhammad.husaini.zulkifli@intel.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=stable@vger.kernel.org \
--cc=tee.min.tan@intel.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).