From: Vladimir Oltean <vladimir.oltean@nxp.com>
To: "netdev@vger.kernel.org" <netdev@vger.kernel.org>
Cc: Claudiu Manoil <claudiu.manoil@nxp.com>,
Alexandre Belloni <alexandre.belloni@bootlin.com>,
"UNGLinuxDriver@microchip.com" <UNGLinuxDriver@microchip.com>,
Heiner Kallweit <hkallweit1@gmail.com>,
Russell King <linux@armlinux.org.uk>,
Sean Anderson <sean.anderson@seco.com>,
Colin Foster <colin.foster@in-advantage.com>,
Andrew Lunn <andrew@lunn.ch>,
Vivien Didelot <vivien.didelot@gmail.com>,
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>
Subject: Re: [PATCH net-next 4/4] net: dsa: remove phylink_validate() method
Date: Tue, 1 Nov 2022 11:59:27 +0000 [thread overview]
Message-ID: <20221101115927.pqg3levft55ysz5f@skbuf> (raw)
In-Reply-To: <20221101114806.1186516-5-vladimir.oltean@nxp.com>
On Tue, Nov 01, 2022 at 01:48:06PM +0200, Vladimir Oltean wrote:
> Not all DSA drivers provide config->mac_capabilities, for example
> mv88e6060, lan9303 and vsc73xx don't. However, there have been users of
> those drivers on recent kernels and no one reported that they fail to
> establish a link, so I'm guessing that they work (somehow). But I must
> admit I don't understand why phylink_generic_validate() works when
> mac_capabilities=0. Anyway, these drivers did not provide a
> phylink_validate() method before and do not provide one now, so nothing
> changes for them.
> diff --git a/net/dsa/port.c b/net/dsa/port.c
> index 208168276995..6e417cdcdb7b 100644
> --- a/net/dsa/port.c
> +++ b/net/dsa/port.c
> @@ -1532,22 +1532,6 @@ static struct phy_device *dsa_port_get_phy_device(struct dsa_port *dp)
> return phydev;
> }
>
> -static void dsa_port_phylink_validate(struct phylink_config *config,
> - unsigned long *supported,
> - struct phylink_link_state *state)
> -{
> - struct dsa_port *dp = container_of(config, struct dsa_port, pl_config);
> - struct dsa_switch *ds = dp->ds;
> -
> - if (!ds->ops->phylink_validate) {
> - if (config->mac_capabilities)
> - phylink_generic_validate(config, supported, state);
Ah, I think I was reading the code wrong, now I think I understand how
phylink_generic_validate() works when config->mac_capabilities=0:
it doesn't; it just wasn't called by the old code.
It will be called after my patch though, so this will break things. I
guess we'll still need a "custom" phylink_validate() which does
something approximating this?
static void dsa_port_phylink_validate(struct phylink_config *config,
unsigned long *supported,
struct phylink_link_state *state)
{
if (config->mac_capabilities) // avoid breaking drivers which don't set this
phylink_generic_validate(config, supported, state);
}
or what else would be preferred?
> - return;
> - }
> -
> - ds->ops->phylink_validate(ds, dp->index, supported, state);
> -}
In any case, please don't merge this as-is, and sorry for realizing the
breakage after the fact.
next prev parent reply other threads:[~2022-11-01 11:59 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-01 11:48 [PATCH net-next 0/4] Remove phylink_validate() from Felix DSA driver Vladimir Oltean
2022-11-01 11:48 ` [PATCH net-next 1/4] net: phy: aquantia: add AQR112 and AQR412 PHY IDs Vladimir Oltean
2022-11-01 15:36 ` Sean Anderson
2022-11-03 11:39 ` Vladimir Oltean
2022-11-01 11:48 ` [PATCH net-next 2/4] net: dsa: felix: use phylink_generic_validate() Vladimir Oltean
2022-11-01 11:48 ` [PATCH net-next 3/4] net: mscc: ocelot: drop workaround for forcing RX flow control Vladimir Oltean
2022-11-01 11:48 ` [PATCH net-next 4/4] net: dsa: remove phylink_validate() method Vladimir Oltean
2022-11-01 11:59 ` Vladimir Oltean [this message]
2022-11-01 12:01 ` Russell King (Oracle)
2022-11-01 12:40 ` Vladimir Oltean
2022-11-01 15:42 ` Russell King (Oracle)
2022-11-04 11:24 ` Russell King (Oracle)
2022-11-04 11:35 ` Russell King (Oracle)
2022-11-04 13:32 ` Vladimir Oltean
2022-11-04 14:01 ` Russell King (Oracle)
2022-11-04 14:25 ` Vladimir Oltean
2022-11-04 14:48 ` Russell King (Oracle)
2022-11-04 15:33 ` Vladimir Oltean
2022-11-04 15:40 ` Florian Fainelli
2022-11-04 16:35 ` Russell King (Oracle)
2022-11-06 1:04 ` Florian Fainelli
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=20221101115927.pqg3levft55ysz5f@skbuf \
--to=vladimir.oltean@nxp.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=alexandre.belloni@bootlin.com \
--cc=andrew@lunn.ch \
--cc=claudiu.manoil@nxp.com \
--cc=colin.foster@in-advantage.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=f.fainelli@gmail.com \
--cc=hkallweit1@gmail.com \
--cc=kuba@kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sean.anderson@seco.com \
--cc=vivien.didelot@gmail.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