[net PATCH] net: stmmac: update priv->speed to SPEED_UNKNOWN when link down

Russell King (Oracle) linux at armlinux.org.uk
Wed May 29 01:46:55 PDT 2024


On Tue, May 28, 2024 at 05:20:10PM +0800, Xiaolei Wang wrote:
> The CBS parameter can still be configured when the port is
> currently disconnected and link down. This is unreasonable.
> The current speed_div and ptr parameters depend on the negotiated
> speed after uplinking. So When the link is down, update priv->speed
> to SPEED_UNKNOWN and an error log should be added.
> 
> Signed-off-by: Xiaolei Wang <xiaolei.wang at windriver.com>

So what happens if stmmac is connected to a PHY that can negotiate with
the link partner, it has link up at e.g. 1G speed, one configures CBS,
and then the link goes down and comes up at a different speed?

I can't see any way in the stmmac driver that this is handled, which
makes this feature way more buggy than you're referring to here. It
also means that with your patch, if one attempts to configure CBS
when the link is down, it will fail.

To me, commit 1f705bc61aee ("net: stmmac: Add support for CBS QDISC")
just looks very buggy.

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



More information about the linux-arm-kernel mailing list