2024-05-28 13:24:04

by Andrew Lunn

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

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.

This sounds like a generic problem. Can the core check the carrier
status and error out there? Maybe return a useful extack message.

If you do need to return an error code, ENETDOWN seems more
appropriate.

Andrew