linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Vladimir Oltean <olteanv@gmail.com>
Cc: Jerry Ray <jerry.ray@microchip.com>, Andrew Lunn <andrew@lunn.ch>,
	Florian Fainelli <f.fainelli@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next v3 2/2] dsa: lan9303: Move to PHYLINK
Date: Tue, 6 Dec 2022 21:07:54 +0000	[thread overview]
Message-ID: <Y4+vKh8EfA9vtC2B@shell.armlinux.org.uk> (raw)
In-Reply-To: <20221206193224.f3obnsjtphbxole4@skbuf>

On Tue, Dec 06, 2022 at 09:32:24PM +0200, Vladimir Oltean wrote:
> On Tue, Dec 06, 2022 at 12:35:00PM -0600, Jerry Ray wrote:
> > This patch replaces the .adjust_link api with the .phylink_get_caps api.
> 
> Am I supposed to read this commit description and understand what the
> change does?
> 
> You can't "replace" adjust_link with phylink_get_caps, since they don't
> do the same thing. The equivalent set of operations are roughly
> phylink_mac_config and phylink_mac_link_up, probably just the latter in
> your case.
> 
> By deleting adjust_link and not replacing with any of the above, the
> change is telling me that nothing from adjust_link was needed?

...

> > -static void lan9303_adjust_link(struct dsa_switch *ds, int port,
> > -				struct phy_device *phydev)
> > -{
> > -	struct lan9303 *chip = ds->priv;
> > -	int ctl;
> > -
> > -	if (!phy_is_pseudo_fixed_link(phydev))
> > -		return;

If this is a not a fixed link, adjust_link does nothing.

> > -
> > -	ctl = lan9303_phy_read(ds, port, MII_BMCR);
> > -
> > -	ctl &= ~BMCR_ANENABLE;
> > -
> > -	if (phydev->speed == SPEED_100)
> > -		ctl |= BMCR_SPEED100;
> > -	else if (phydev->speed == SPEED_10)
> > -		ctl &= ~BMCR_SPEED100;
> > -	else
> > -		dev_err(ds->dev, "unsupported speed: %d\n", phydev->speed);
> > -
> > -	if (phydev->duplex == DUPLEX_FULL)
> > -		ctl |= BMCR_FULLDPLX;
> > -	else
> > -		ctl &= ~BMCR_FULLDPLX;
> > -
> > -	lan9303_phy_write(ds, port, MII_BMCR, ctl);
> 
> Are you going to explain why modifying this register is no longer needed?

... otherwise it is a fixed link, so the PHY is configured for the fixed
link setting - which I think would end up writing to the an emulation of
the PHY, and would end up writing the same settings back to the PHY as
the PHY was already configured.

So, I don't think adjust_link does anything useful, and I think this is
an entirely appropriate change.

-- 
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:[~2022-12-06 21:08 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-06 18:34 [PATCH net-next v3 0/2] dsa: lan9303: Move to PHYLINK Jerry Ray
2022-12-06 18:34 ` [PATCH net-next v3 1/2] dsa: lan9303: Add port_max_mtu API Jerry Ray
2022-12-06 18:56   ` Vladimir Oltean
2022-12-06 23:44     ` Jerry.Ray
2022-12-07 11:39       ` Vladimir Oltean
2022-12-06 18:35 ` [PATCH net-next v3 2/2] dsa: lan9303: Move to PHYLINK Jerry Ray
2022-12-06 19:32   ` Vladimir Oltean
2022-12-06 21:07     ` Russell King (Oracle) [this message]
2022-12-06 22:12       ` Vladimir Oltean
2022-12-06 22:58       ` Jerry.Ray
2022-12-07 14:01         ` Vladimir Oltean
2022-12-06 18:57 ` [PATCH net-next v3 0/2] " Vladimir Oltean
2022-12-06 23:58   ` Jerry.Ray

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=Y4+vKh8EfA9vtC2B@shell.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=f.fainelli@gmail.com \
    --cc=jerry.ray@microchip.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).