mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: "Jamaluddin, Aminuddin" <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>,
	"Ismail, Mohammad Athari" <mohammad.athari.ismail@intel.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>,
	"Tan, Tee Min" <tee.min.tan@intel.com>,
	"Zulkifli,
	Muhammad Husaini" <muhammad.husaini.zulkifli@intel.com>
Subject: Re: [PATCH net 1/1] net: phy: marvell: add link status check before enabling phy loopback
Date: Tue, 30 Aug 2022 14:17:00 +0200	[thread overview]
Message-ID: <Yw3/vIDAr9W7zZwv@lunn.ch> (raw)
In-Reply-To: <DM6PR11MB43480C1D3526031F79592A7F81799@DM6PR11MB4348.namprd11.prod.outlook.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?
>  
> Its required cabled plug in, back to back connection.

Loopback should not require that. The whole point of loopback in the
PHY is you can do it without needing a cable.

> > 
> > Have you tested this with the cable unplugged?
> 
> Yes we have and its expected to have the timeout. But the self-test required the link
> to be up first before it can be run.

So you get an ETIMEDOUT, and then skip the code which actually sets
the LOOPBACK bit?

Please look at this again, and make it work without a cable.

Maybe you are addressing the wrong issue? Is the PHY actually
performing loopback, but reporting the link is down? Maybe you need to
fake a link up? Maybe you need the self test to not care about the
link state, all it really needs is that packets get looped?

       Andrew

  reply	other threads:[~2022-08-30 12:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-25  8:22 Aminuddin Jamaluddin
2022-08-25 13:26 ` Andrew Lunn
2022-08-30  7:51   ` Jamaluddin, Aminuddin
2022-08-30 12:17     ` Andrew Lunn [this message]
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=Yw3/vIDAr9W7zZwv@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

all inboxes | Powered by JetHome®