[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <BL0PR11MB29135A585E15976470CF932EE7DD2@BL0PR11MB2913.namprd11.prod.outlook.com>
Date: Wed, 3 Jul 2024 19:26:37 +0000
From: <Woojung.Huh@...rochip.com>
To: <andrew@...n.ch>, <o.rempel@...gutronix.de>
CC: <davem@...emloft.net>, <edumazet@...gle.com>, <f.fainelli@...il.com>,
<kuba@...nel.org>, <pabeni@...hat.com>, <Arun.Ramadoss@...rochip.com>,
<hkallweit1@...il.com>, <linux@...linux.org.uk>,
<Yuiko.Oshino@...rochip.com>, <kernel@...gutronix.de>,
<linux-kernel@...r.kernel.org>, <netdev@...r.kernel.org>,
<UNGLinuxDriver@...rochip.com>
Subject: RE: [PATCH net v1 2/2] net: phy: microchip: lan87xx: do not report
SQI if no link
Hi Andrew & Oleksij,
> On Wed, Jul 03, 2024 at 03:28:01PM +0200, Oleksij Rempel wrote:
> > Do not report SQI if no link is detected. Otherwise ethtool will show
> > non zero value even if no cable is attached.
> >
> > Fixes: b649695248b15 ("net: phy: LAN87xx: add ethtool SQI support")
> > Signed-off-by: Oleksij Rempel <o.rempel@...gutronix.de>
> > ---
> > drivers/net/phy/microchip_t1.c | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > diff --git a/drivers/net/phy/microchip_t1.c
> b/drivers/net/phy/microchip_t1.c
> > index a35528497a576..22530a5b76365 100644
> > --- a/drivers/net/phy/microchip_t1.c
> > +++ b/drivers/net/phy/microchip_t1.c
> > @@ -840,6 +840,9 @@ static int lan87xx_get_sqi(struct phy_device *phydev)
> > u8 sqi_value = 0;
> > int rc;
> >
> > + if (!phydev->link)
> > + return 0;
> > +
>
> Is this the correct place to fix this? Can any PHY report an SQI value
> if there is no link? Maybe an automotive PHY using T1 and good old
> fashioned CSMA/CD could report about background noise? But do they?
>
> Maybe this should be fixed in linkstate_get_sqi()?
>
> Also, maybe it should return -ENETDOWN, not 0. Do we want to say
> "worse than class A SQI (unstable link)" when in fact the link is
> "class G SQI (very good link)" once it is up?
I lean to Andew's idea because "SQI values are only valid
if link-up condition is present" per OpenAlliance specification of
100Base-T1 Interoperability Test suite. [1]
[1] https://opensig.org/automotive-ethernet-specifications/#
Thanks.
Woojung
Powered by blists - more mailing lists