From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Jerry Ray <jerry.ray@microchip.com>
Cc: Andrew Lunn <andrew@lunn.ch>,
Florian Fainelli <f.fainelli@gmail.com>,
Vladimir Oltean <olteanv@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 v2 2/2] dsa: lan9303: Move to PHYLINK
Date: Fri, 2 Dec 2022 19:54:39 +0000 [thread overview]
Message-ID: <Y4pX//cG2Hq8NvbM@shell.armlinux.org.uk> (raw)
In-Reply-To: <20221202191749.27437-3-jerry.ray@microchip.com>
Hi Jerry,
On Fri, Dec 02, 2022 at 01:17:49PM -0600, Jerry Ray wrote:
> -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;
> -
> - 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);
> -
> - if (port == chip->phy_addr_base) {
> - /* Virtual Phy: Remove Turbo 200Mbit mode */
> - lan9303_read(chip->regmap, LAN9303_VIRT_SPECIAL_CTRL, &ctl);
> -
> - ctl &= ~LAN9303_VIRT_SPECIAL_TURBO;
> - regmap_write(chip->regmap, LAN9303_VIRT_SPECIAL_CTRL, ctl);
> - }
> -}
Is this functionality no longer necessary? For example, I don't see
anywhere else in the driver that this turbo mode is disabled.
I'm guessing the above code writing MII_BMCR is to force the
configuration of integrated PHYs to be the fixed-link settings?
How is that dealt with after the removal of the above code?
> -
> static int lan9303_port_enable(struct dsa_switch *ds, int port,
> struct phy_device *phy)
> {
> @@ -1279,6 +1243,41 @@ static int lan9303_port_mdb_del(struct dsa_switch *ds, int port,
> return 0;
> }
>
> +static void lan9303_phylink_get_caps(struct dsa_switch *ds, int port,
> + struct phylink_config *config)
> +{
> + struct lan9303 *chip = ds->priv;
> +
> + dev_dbg(chip->dev, "%s(%d) entered.", __func__, port);
> +
> + config->mac_capabilities = MAC_10 | MAC_100 | MAC_ASYM_PAUSE |
> + MAC_SYM_PAUSE;
> +
> + if (dsa_port_is_cpu(dsa_to_port(ds, port))) {
> + /* cpu port */
> + phy_interface_empty(config->supported_interfaces);
This should not be necessary - the supported_interfaces member should
already be zero.
Thanks.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!
next prev parent reply other threads:[~2022-12-02 19:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-02 19:17 [PATCH net-next v2 0/2] dsa: lan9303: Move to PHYLINK Jerry Ray
2022-12-02 19:17 ` [PATCH net-next v2 1/2] dsa: lan9303: Add port_max_mtu API Jerry Ray
2022-12-02 19:17 ` [PATCH net-next v2 2/2] dsa: lan9303: Move to PHYLINK Jerry Ray
2022-12-02 19:54 ` Russell King (Oracle) [this message]
2022-12-06 16:48 ` 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=Y4pX//cG2Hq8NvbM@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 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.