All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Vladimir Oltean <vladimir.oltean@nxp.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	Antoine Tenart <atenart@kernel.org>,
	Michael Walle <michael@walle.cc>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Andrew Lunn <andrew@lunn.ch>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Ioana Ciornei <ioana.ciornei@nxp.com>,
	Maxim Kochetkov <fido_max@inbox.ru>,
	Bjarni Jonasson <bjarni.jonasson@microchip.com>,
	Steen Hegelund <steen.hegelund@microchip.com>,
	"UNGLinuxDriver@microchip.com" <UNGLinuxDriver@microchip.com>,
	"bcm-kernel-feedback-list@broadcom.com" 
	<bcm-kernel-feedback-list@broadcom.com>,
	Nicolas Ferre <nicolas.ferre@microchip.com>,
	Claudiu Beznea <claudiu.beznea@microchip.com>
Subject: Re: [RFC PATCH v3 net-next 2/6] net: phylink: introduce a generic method for querying PHY in-band autoneg capability
Date: Thu, 23 Sep 2021 00:03:22 +0100	[thread overview]
Message-ID: <YUu2OlXElk5GR/3N@shell.armlinux.org.uk> (raw)
In-Reply-To: <20210922214827.wczsgk3yw3vjsv5w@skbuf>

On Wed, Sep 22, 2021 at 09:48:28PM +0000, Vladimir Oltean wrote:
> On Thu, Sep 23, 2021 at 12:31:16AM +0300, Vladimir Oltean wrote:
> > On Wed, Sep 22, 2021 at 10:22:19PM +0100, Russell King (Oracle) wrote:
> > > On Wed, Sep 22, 2021 at 09:14:42PM +0300, Vladimir Oltean wrote:
> > > > +static unsigned int phylink_fixup_inband_aneg(struct phylink *pl,
> > > > +					      struct phy_device *phy,
> > > > +					      unsigned int mode)
> > > > +{
> > > > +	int ret;
> > > > +
> > > > +	ret = phy_validate_inband_aneg(phy, pl->link_interface);
> > > > +	if (ret == PHY_INBAND_ANEG_UNKNOWN) {
> > > > +		phylink_dbg(pl,
> > > > +			    "PHY driver does not report in-band autoneg capability, assuming %s\n",
> > > > +			    phylink_autoneg_inband(mode) ? "true" : "false");
> > > > +
> > > > +		return mode;
> > > > +	}
> > > > +
> > > > +	if (phylink_autoneg_inband(mode) && !(ret & PHY_INBAND_ANEG_ON)) {
> > > > +		phylink_err(pl,
> > > > +			    "Requested in-band autoneg but driver does not support this, disabling it.\n");
> > > 
> > > If we add support to the BCM84881 driver to work with
> > > phy_validate_inband_aneg(), then this will always return
> > > PHY_INBAND_ANEG_OFF and never PHY_INBAND_ANEG_ON. Consequently,
> > > this will always produce this "error". It is not an error in the
> > > SFP case, but it is if firmware is misconfigured.
> > > 
> > > So, this needs better handling - we should not be issuing an error-
> > > level kernel message for something that is "normal".
> > 
> > Is this better?
> > 
> > 		phylink_printk(phy_on_sfp(phy) ? KERN_DEBUG : KERN_ERR, pl,
> > 			       "Requested in-band autoneg but driver does not support this, disabling it.\n");
> 
> Ah, not sure whether that was a trick question or not, but
> phylink_fixup_inband_aneg function does not get called for the SFP code
> path, I even noted this in the commit message but forgot:

No it wasn't a trick question. I thought you were calling
phylink_fixup_inband_aneg() from phylink_sfp_config(), but I see now
that you don't. That's what happens when you try and rush to review.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

  reply	other threads:[~2021-09-22 23:03 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-22 18:14 [RFC PATCH v3 net-next 0/6] Let phylink manage in-band AN for the PHY Vladimir Oltean
2021-09-22 18:14 ` [RFC PATCH v3 net-next 1/6] net: phylink: pass the phy argument to phylink_sfp_config Vladimir Oltean
2021-09-22 18:14 ` [RFC PATCH v3 net-next 2/6] net: phylink: introduce a generic method for querying PHY in-band autoneg capability Vladimir Oltean
2021-09-22 21:22   ` Russell King (Oracle)
2021-09-22 21:31     ` Vladimir Oltean
2021-09-22 21:48       ` Vladimir Oltean
2021-09-22 23:03         ` Russell King (Oracle) [this message]
2021-09-22 23:50           ` Vladimir Oltean
2021-09-23  8:19             ` Russell King (Oracle)
2021-09-23  9:58               ` Vladimir Oltean
2021-09-23 10:20                 ` Russell King (Oracle)
2021-09-22 18:14 ` [RFC PATCH v3 net-next 3/6] net: phy: bcm84881: move the in-band capability check where it belongs Vladimir Oltean
2021-09-22 18:14 ` [RFC PATCH v3 net-next 4/6] net: phylink: explicitly configure in-band autoneg for PHYs that support it Vladimir Oltean
2021-09-22 18:14 ` [RFC PATCH v3 net-next 5/6] net: phy: mscc: configure in-band auto-negotiation for VSC8514 Vladimir Oltean
2021-09-22 18:14 ` [RFC PATCH v3 net-next 6/6] net: phy: at803x: configure in-band auto-negotiation for AR8031/AR8033 Vladimir Oltean

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=YUu2OlXElk5GR/3N@shell.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=andrew@lunn.ch \
    --cc=atenart@kernel.org \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=bjarni.jonasson@microchip.com \
    --cc=claudiu.beznea@microchip.com \
    --cc=f.fainelli@gmail.com \
    --cc=fido_max@inbox.ru \
    --cc=hkallweit1@gmail.com \
    --cc=ioana.ciornei@nxp.com \
    --cc=michael@walle.cc \
    --cc=netdev@vger.kernel.org \
    --cc=nicolas.ferre@microchip.com \
    --cc=steen.hegelund@microchip.com \
    --cc=vladimir.oltean@nxp.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.