All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <simon.horman@corigine.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: "Michael Walle" <mwalle@kernel.org>,
	"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>,
	"Yisen Zhuang" <yisen.zhuang@huawei.com>,
	"Salil Mehta" <salil.mehta@huawei.com>,
	"Florian Fainelli" <florian.fainelli@broadcom.com>,
	"Broadcom internal kernel review list"
	<bcm-kernel-feedback-list@broadcom.com>,
	"Marek Behún" <kabel@kernel.org>, "Xu Liang" <lxu@maxlinear.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next v2 06/10] net: phy: print an info if a broken C45 bus is found
Date: Fri, 23 Jun 2023 22:35:17 +0200	[thread overview]
Message-ID: <ZJYCBeKdXBot/9Xd@corigine.com> (raw)
In-Reply-To: <af166ce6-b9b2-44e0-9f45-2b2aa001fd6b@lunn.ch>

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@kernel.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
> > 
> 

  reply	other threads:[~2023-06-23 20:36 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-23 10:29 [PATCH net-next v2 00/10] net: phy: C45-over-C22 access Michael Walle
2023-06-23 10:29 ` [PATCH net-next v2 01/10] net: phy: add error checks in mmd_phy_indirect() and export it Michael Walle
2023-06-23 10:29 ` [PATCH net-next v2 02/10] net: phy: get rid of redundant is_c45 information Michael Walle
2023-06-23 10:29 ` [PATCH net-next v2 03/10] net: phy: introduce phy_is_c45() Michael Walle
2023-06-23 17:15   ` Andrew Lunn
2023-06-23 10:29 ` [PATCH net-next v2 04/10] net: phy: replace is_c45 with phy_accces_mode Michael Walle
2023-06-23 17:34   ` Andrew Lunn
2023-06-23 19:54     ` Andrew Lunn
2023-06-26  6:31       ` Michael Walle
2023-06-23 10:29 ` [PATCH net-next v2 05/10] net: phy: make the "prevent_c45_scan" a property of the MII bus Michael Walle
2023-06-23 10:29 ` [PATCH net-next v2 06/10] net: phy: print an info if a broken C45 bus is found Michael Walle
2023-06-23 17:42   ` Andrew Lunn
2023-06-23 20:35     ` Simon Horman [this message]
2023-06-26  6:50       ` Michael Walle
2023-06-23 10:29 ` [PATCH net-next v2 07/10] net: phy: add support for C45-over-C22 transfers Michael Walle
2023-06-23 20:43   ` Simon Horman
2023-06-24 20:15   ` Andrew Lunn
2023-06-26  7:14     ` Michael Walle
2023-06-23 10:29 ` [PATCH net-next v2 08/10] net: phy: introduce phy_promote_to_c45() Michael Walle
2023-06-23 10:29 ` [PATCH net-next v2 09/10] net: mdio: add C45-over-C22 fallback to fwnode_mdiobus_register_phy() Michael Walle
2023-06-23 10:29 ` [PATCH net-next v2 10/10] net: mdio: support C45-over-C22 when probed via OF Michael Walle
2023-06-23 20:48   ` Simon Horman
2023-06-26  7:37     ` Michael Walle

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=ZJYCBeKdXBot/9Xd@corigine.com \
    --to=simon.horman@corigine.com \
    --cc=andrew@lunn.ch \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=florian.fainelli@broadcom.com \
    --cc=hkallweit1@gmail.com \
    --cc=kabel@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=lxu@maxlinear.com \
    --cc=mwalle@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=salil.mehta@huawei.com \
    --cc=yisen.zhuang@huawei.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.