summaryrefslogtreecommitdiff
path: root/include/linux/timerqueue.h
diff options
context:
space:
mode:
authorCosmin Ratiu <cratiu@nvidia.com>2026-10-21 17:41:11 +0300
committerJohannes Berg <johannes.berg@intel.com>2026-10-22 12:00:05 +0200
commit48c0045366bec142d053f7cf76fb9dd7127cd231 (patch)
treed1ecd627742e202a59f44ac72d80c40a3a2cd546 /include/linux/timerqueue.h
parent7ed5dce55fa8393972b1bf2bf5af1c818c5e7dc2 (diff)
wifi: wext: Limit notifier event flushes to the device's netns
With mlx5 netdev instance locking enabled, registering an IPoIB netdev calls the WEXT notifier while holding the instance mutex. Its call to wireless_nlevent_flush() takes net_rwsem to walk every namespace, completing the following lockdep dependency cycle: netdev instance mutex -> net_rwsem (read) -> GID table mutex -> event_handler_rwsem (read) -> netdev instance mutex RoCE GID enumeration takes the GID table mutex under net_rwsem. GID updates dispatch events under the table mutex, taking event_handler_rwsem. The IPoIB event handler takes the netdev instance mutex in ipoib_queue_work() to traverse child interfaces. The all-namespace walk originated in the single global worker servicing per-namespace WEXT queues. The ordering fixes later reused that routine in netdevice notifiers to prevent delayed WEXT RTM_NEWLINK messages from following RTM_DELLINK or reporting stale interface flags. A notifier only needs to drain the affected device's namespace; there is no reason for it to walk and flush all namespaces. Pass dev_net(dev) from both notifier callers and make the flush helper operate on that namespace. Keep the all-namespace walk and net_rwsem in the existing worker. This removes the instance-mutex -> net_rwsem dependency while retaining synchronous flushing from the notifiers. It may seem strange that the fix for a lock cycle across multiple subsystems lies in a completely unrelated part of the code, but this seemed the most justified lock cycle edge to break. Fixes: 8f7b00307bf1 ("net/mlx5e: Convert mlx5 netdevs to instance locking") Signed-off-by: Cosmin Ratiu <cratiu@nvidia.com> Link: https://patch.msgid.link/20261021144111.611840-1-cratiu@nvidia.com Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'include/linux/timerqueue.h')
0 files changed, 0 insertions, 0 deletions