[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230726163620.2vda2noig7wwk3jo@skbuf>
Date: Wed, 26 Jul 2023 19:36:20 +0300
From: Vladimir Oltean <olteanv@...il.com>
To: "Russell King (Oracle)" <rmk+kernel@...linux.org.uk>
Cc: Andrew Lunn <andrew@...n.ch>, 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>,
netdev@...r.kernel.org, Sergei Antonov <saproj@...il.com>
Subject: Re: [PATCH net] net: dsa: fix older DSA drivers using phylink
On Wed, Jul 26, 2023 at 03:45:16PM +0100, Russell King (Oracle) wrote:
> Older DSA drivers that do not provide an dsa_ops adjust_link method end
> up using phylink. Unfortunately, a recent phylink change that requires
> its supported_interfaces bitmap to be filled breaks these drivers
> because the bitmap remains empty.
>
> Rather than fixing each driver individually, fix it in the core code so
> we have a sensible set of defaults.
>
> Reported-by: Sergei Antonov <saproj@...il.com>
> Fixes: de5c9bf40c45 ("net: phylink: require supported_interfaces to be filled")
> Signed-off-by: Russell King (Oracle) <rmk+kernel@...linux.org.uk>
> ---
Reviewed-by: Vladimir Oltean <olteanv@...il.com>
Tested-by: Vladimir Oltean <olteanv@...il.com> # dsa_loop
Thanks!
> net/dsa/port.c | 9 ++++++++-
> 1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/net/dsa/port.c b/net/dsa/port.c
> index 0ce8fd311c78..2f6195d7b741 100644
> --- a/net/dsa/port.c
> +++ b/net/dsa/port.c
> @@ -1727,8 +1727,15 @@ int dsa_port_phylink_create(struct dsa_port *dp)
> ds->ops->phylink_mac_an_restart)
> dp->pl_config.legacy_pre_march2020 = true;
>
> - if (ds->ops->phylink_get_caps)
> + if (ds->ops->phylink_get_caps) {
> ds->ops->phylink_get_caps(ds, dp->index, &dp->pl_config);
> + } else {
> + /* For legacy drivers */
> + __set_bit(PHY_INTERFACE_MODE_INTERNAL,
> + dp->pl_config.supported_interfaces);
> + __set_bit(PHY_INTERFACE_MODE_GMII,
> + dp->pl_config.supported_interfaces);
> + }
>
> pl = phylink_create(&dp->pl_config, of_fwnode_handle(dp->dn),
> mode, &dsa_port_phylink_mac_ops);
> --
> 2.30.2
>
Powered by blists - more mailing lists