]> git.ipfire.org Git - thirdparty/linux.git/commit
wifi: mac80211: Remove redundant rcu_read_lock/unlock() in spin_lock
authorpengdonglin <pengdonglin@xiaomi.com>
Tue, 16 Sep 2025 04:47:31 +0000 (12:47 +0800)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 19 Sep 2025 09:48:14 +0000 (11:48 +0200)
commit872e397d62a67843ea09cf6641819cb1a7e5ee98
treee5d3e4ff75f68f9b7411d02f74b50132e86d7870
parenta37a6f54439bf82b827a7072415d3a4afa4e12bd
wifi: mac80211: Remove redundant rcu_read_lock/unlock() in spin_lock

Since commit a8bb74acd8efe ("rcu: Consolidate RCU-sched update-side function definitions")
there is no difference between rcu_read_lock(), rcu_read_lock_bh() and
rcu_read_lock_sched() in terms of RCU read section and the relevant grace
period. That means that spin_lock(), which implies rcu_read_lock_sched(),
also implies rcu_read_lock().

There is no need no explicitly start a RCU read section if one has already
been started implicitly by spin_lock().

Simplify the code and remove the inner rcu_read_lock() invocation.

Cc: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: pengdonglin <pengdonglin@xiaomi.com>
Signed-off-by: pengdonglin <dolinux.peng@gmail.com>
Link: https://patch.msgid.link/20250916044735.2316171-11-dolinux.peng@gmail.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/cfg.c
net/mac80211/debugfs.c
net/mac80211/debugfs_netdev.c
net/mac80211/debugfs_sta.c
net/mac80211/sta_info.c