Re: [PATCH net-next v9 1/3] net: macb: cache ENST config across link down/up
From: Nicolai Buchwitz
Date: Sat Nov 28 2026 - 07:50:41 EST
On 27.11.2026 22:44, Théo Lebrun wrote:
Currently, ENST is not explicitly restored across interface close/open.
If HW keeps its register state then ENST is kept, otherwise it is lost;
but we do not write the ENST schedule again on open.
This causes trouble if the config is not compatible with the new open
and link-up. The two issues that can occur are a link speed change (as
all timings are configured in a unit relative to the link speed) or a
change in the # of queues.
The latter is the main reason we do this change before implementing
ethtool -L support.
If on link-up, the cached ENST config is invalid (link speed changed),
then we ignore the cached config, log a warning and disable ENST on all
queues. If it is valid, we explicitly re-apply it.
We ignore the cached config, hoping the current link speed is a degraded
state which will recover.
Take this opportunity to replace a kmalloc in
macb_taprio_setup_replace() with a simple and tiny (104b) stack value.
Drop the old hack of checking for pm_runtime_suspended(), which has
little value because we could race with the runtime_suspend() call.
Synchronise our config using the existing bp->mac_cfg_lock mutex, taken
by macb_taprio_setup_replace() and macb_taprio_destroy(). To avoid an
ABBA deadlock between bp->mac_cfg_lock and phydev->lock taken by
phylink_ethtool_ksettings_get(), cache the link speed as bp->speed_mbps.
Fixes: 89934dbf169e ("net: macb: Add TAPRIO traffic scheduling support")
Cc: <stable+noautosel@xxxxxxxxxx> # more a feature than a bugfix!
Signed-off-by: Théo Lebrun <theo.lebrun@xxxxxxxxxxx>
---
[...]
Reviewed-by: Nicolai Buchwitz <nb@xxxxxxxxxxx>
Thanks,
Nicolai