[PATCH net v2 2/4] net: sparx5: fix sleep in atomic context in MAC table access
Jakub Kicinski
kuba at kernel.org
Thu May 7 09:05:18 PDT 2026
On Wed, 6 May 2026 09:25:37 +0200 Daniel Machon wrote:
> sparx5_set_rx_mode() runs with netif_addr_lock_bh held and iterates
> dev->mc via __dev_mc_sync(), which per address calls sparx5_mc_sync() /
> sparx5_mc_unsync() -> sparx5_mact_learn() / sparx5_mact_forget(). These
> take sparx5->lock, a mutex, and then poll the MAC access command
> register with readx_poll_timeout(). A mutex may block, which is not
> allowed from atomic context.
>
> Convert the driver to the new .ndo_set_rx_mode_async callback introduced
> in commit 3554b4345d85 ("net: introduce ndo_set_rx_mode_async and
> netdev_rx_mode_work"). The async callback is invoked from process
> context, so the mutex and sleeping completion poll can remain.
Sashiko points out that the switchdev handlers are currently racy,
but I think that's orthogonal.
More information about the linux-arm-kernel
mailing list