lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Fri, 23 Jun 2023 22:35:17 +0200
From: Simon Horman <simon.horman@...igine.com>
To: Andrew Lunn <andrew@...n.ch>
Cc: Michael Walle <mwalle@...nel.org>,
	Heiner Kallweit <hkallweit1@...il.com>,
	Russell King <linux@...linux.org.uk>,
	"David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
	Yisen Zhuang <yisen.zhuang@...wei.com>,
	Salil Mehta <salil.mehta@...wei.com>,
	Florian Fainelli <florian.fainelli@...adcom.com>,
	Broadcom internal kernel review list <bcm-kernel-feedback-list@...adcom.com>,
	Marek BehĂșn <kabel@...nel.org>,
	Xu Liang <lxu@...linear.com>, netdev@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next v2 06/10] net: phy: print an info if a broken
 C45 bus is found

On Fri, Jun 23, 2023 at 07:42:08PM +0200, Andrew Lunn wrote:
> On Fri, Jun 23, 2023 at 12:29:15PM +0200, Michael Walle wrote:
> > If there is an PHY which gets confused by C45 transactions on the MDIO
> > bus, print an info together with the PHY identifier of the offending
> > one.
> > 
> > Signed-off-by: Michael Walle <mwalle@...nel.org>
> > 
> > ---
> > I wasn't sure if this should be phydev_dbg() or phydev_info(). I mainly
> > see this as an info to a user why some PHYs might not be probed (or
> > c45-over-c22 is used later).
> 
> The information is useful to the DT writer, not the 'user'. I would
> assume the DT writer has a bit more kernel knowledge and can debug
> prints on. So i would suggest phydev_dbg().
> 
> > @@ -617,10 +617,10 @@ static int mdiobus_scan_bus_c45(struct mii_bus *bus)
> >   */
> >  void mdiobus_scan_for_broken_c45_access(struct mii_bus *bus)
> >  {
> > +	struct phy_device *phydev;
> >  	int i;
> >  
> >  	for (i = 0; i < PHY_MAX_ADDR; i++) {
> > -		struct phy_device *phydev;
> >  		u32 oui;
> 
> It is not clear why you changed the scope of phydev. I guess another
> version used phydev_info(), where as now you have dev_info()?

I think it is so it can be used in the dev_info() call below.
However Smatch has it's doubts that it is always initialised there.

  .../mdio_bus.c:638 mdiobus_scan_for_broken_c45_access() error: we previously assumed 'phydev' could be null (see line 627)

> >  		phydev = mdiobus_get_phy(bus, i);

Line 627 immediately follows the line above, like this:

		if (!phydev)
			continue;

> > @@ -633,6 +633,11 @@ void mdiobus_scan_for_broken_c45_access(struct mii_bus *bus)
> >  			break;
> >  		}
> >  	}
> > +
> > +	if (bus->prevent_c45_access)
> > +		dev_info(&bus->dev,
> > +			 "Detected broken PHY (ID %08lx). Disabling C45 bus transactions.\n",
> > +			 (unsigned long)phydev->phy_id);
> >  }
> >  
> >  /**
> > 
> > -- 
> > 2.39.2
> > 
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ