Netdev List
 help / color / mirror / Atom feed
From: Vladimir Oltean <olteanv@gmail.com>
To: "Russell King (Oracle)" <rmk+kernel@armlinux.org.uk>
Cc: 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, Sergei Antonov <saproj@gmail.com>
Subject: Re: [PATCH net] net: dsa: fix older DSA drivers using phylink
Date: Wed, 26 Jul 2023 19:36:20 +0300	[thread overview]
Message-ID: <20230726163620.2vda2noig7wwk3jo@skbuf> (raw)
In-Reply-To: <E1qOflM-001AEz-D3@rmk-PC.armlinux.org.uk>

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@gmail.com>
> Fixes: de5c9bf40c45 ("net: phylink: require supported_interfaces to be filled")
> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
> ---

Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
Tested-by: Vladimir Oltean <olteanv@gmail.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
> 

  reply	other threads:[~2023-07-26 16:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-26 14:45 [PATCH net] net: dsa: fix older DSA drivers using phylink Russell King (Oracle)
2023-07-26 16:36 ` Vladimir Oltean [this message]
2023-07-26 16:37 ` Florian Fainelli
2023-07-28  0:50 ` patchwork-bot+netdevbpf
2023-07-28 10:23 ` [PATCH net] net: dsa: fix older DSA drivers using phylink - manual merge Matthieu Baerts
2023-07-28 10:37   ` Russell King (Oracle)
2023-07-28 11:23     ` Matthieu Baerts

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=20230726163620.2vda2noig7wwk3jo@skbuf \
    --to=olteanv@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=f.fainelli@gmail.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rmk+kernel@armlinux.org.uk \
    --cc=saproj@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