Re: [PATCH net-next v2 06/10] net: phy: print an info if a broken C45 bus is found

From: Andrew Lunn
Date: Fri Jun 23 2023 - 13:42:25 EST


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@xxxxxxxxxx>
>
> ---
> 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()?

Andrew

>
> phydev = mdiobus_get_phy(bus, i);
> @@ -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
>