[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20221101115927.pqg3levft55ysz5f@skbuf>
Date: Tue, 1 Nov 2022 11:59:27 +0000
From: Vladimir Oltean <vladimir.oltean@....com>
To: "netdev@...r.kernel.org" <netdev@...r.kernel.org>
CC: Claudiu Manoil <claudiu.manoil@....com>,
Alexandre Belloni <alexandre.belloni@...tlin.com>,
"UNGLinuxDriver@...rochip.com" <UNGLinuxDriver@...rochip.com>,
Heiner Kallweit <hkallweit1@...il.com>,
Russell King <linux@...linux.org.uk>,
Sean Anderson <sean.anderson@...o.com>,
Colin Foster <colin.foster@...advantage.com>,
Andrew Lunn <andrew@...n.ch>,
Vivien Didelot <vivien.didelot@...il.com>,
Florian Fainelli <f.fainelli@...il.com>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>
Subject: Re: [PATCH net-next 4/4] net: dsa: remove phylink_validate() method
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.
Powered by blists - more mailing lists