lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZhAlmRQ0pz+ibqGB@shell.armlinux.org.uk>
Date: Fri, 5 Apr 2024 17:23:53 +0100
From: "Russell King (Oracle)" <linux@...linux.org.uk>
To: Vladimir Oltean <olteanv@...il.com>
Cc: Andrew Lunn <andrew@...n.ch>, "David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Florian Fainelli <f.fainelli@...il.com>,
	Jakub Kicinski <kuba@...nel.org>, netdev@...r.kernel.org,
	Paolo Abeni <pabeni@...hat.com>
Subject: Re: [PATCH RFC net-next 2/3] net: dsa: allow DSA switch drivers to
 provide their own phylink mac ops

On Fri, Apr 05, 2024 at 07:21:00PM +0300, Vladimir Oltean wrote:
> On Wed, Apr 03, 2024 at 03:18:41PM +0100, Russell King (Oracle) wrote:
> > diff --git a/net/dsa/port.c b/net/dsa/port.c
> > index 02bf1c306bdc..4cafbc505009 100644
> > --- a/net/dsa/port.c
> > +++ b/net/dsa/port.c
> > @@ -1662,6 +1662,7 @@ static const struct phylink_mac_ops dsa_port_phylink_mac_ops = {
> >  
> >  int dsa_port_phylink_create(struct dsa_port *dp)
> >  {
> > +	const struct phylink_mac_ops *mac_ops;
> >  	struct dsa_switch *ds = dp->ds;
> >  	phy_interface_t mode;
> >  	struct phylink *pl;
> > @@ -1685,8 +1686,12 @@ int dsa_port_phylink_create(struct dsa_port *dp)
> >  		}
> >  	}
> >  
> > -	pl = phylink_create(&dp->pl_config, of_fwnode_handle(dp->dn),
> > -			    mode, &dsa_port_phylink_mac_ops);
> > +	mac_ops = &dsa_port_phylink_mac_ops;
> > +	if (ds->phylink_mac_ops)
> > +		mac_ops = ds->phylink_mac_ops;
> > +
> > +	pl = phylink_create(&dp->pl_config, of_fwnode_handle(dp->dn), mode,
> > +			    mac_ops);
> >  	if (IS_ERR(pl)) {
> >  		pr_err("error creating PHYLINK: %ld\n", PTR_ERR(pl));
> >  		return PTR_ERR(pl);
> > -- 
> > 2.30.2
> > 
> 
> This is not sufficient. We will have to make DSA call the driver through
> the mac_ops it provides, rather than through ds->ops, here:
> 
> dsa_shared_port_link_register_of()
> 
> 	if (!ds->ops->adjust_link) {
> 		if (missing_link_description) {
> 			dev_warn(ds->dev,
> 				 "Skipping phylink registration for %s port %d\n",
> 				 dsa_port_is_cpu(dp) ? "CPU" : "DSA", dp->index);
> 		} else {
> 			if (ds->ops->phylink_mac_link_down)
> 				ds->ops->phylink_mac_link_down(ds, port,
> 					MLO_AN_FIXED, PHY_INTERFACE_MODE_NA);
> 			~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> 			return dsa_shared_port_phylink_register(dp);
> 		}
> 		return 0;
> 	}
> 
> Coincidentally mv88e6xxx is exactly one of those drivers which needs the
> early mac_link_down() call that isn't driven by phylink.

Thanks for the review, I'd forgotten that this path exists!

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ