Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 393bbf65 authored by Johannes Berg's avatar Johannes Berg Committed by Alistair Strachan
Browse files

UPSTREAM: mac80211_hwsim: fix PS debugfs file locking



The functions called within the iterators must be called with
tasklets disabled, so use atomic iteration like the rest of
the code and disable tasklets around the whole operation.

Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
(cherry picked from commit a809ca5e03c6dd3b324d148564715ca5ea2b8103)
Bug: 70214720
Change-Id: Ie1a12866bbcfc88037782eb3c2a8d967a52a9937
Signed-off-by: default avatarAlistair Strachan <astrachan@google.com>
parent 3fd0c96b
Loading
Loading
Loading
Loading
+11 −11
Original line number Diff line number Diff line
@@ -614,22 +614,22 @@ static int hwsim_fops_ps_write(void *dat, u64 val)
	old_ps = data->ps;
	data->ps = val;

	local_bh_disable();
	if (val == PS_MANUAL_POLL) {
		ieee80211_iterate_active_interfaces(data->hw,
						    IEEE80211_IFACE_ITER_NORMAL,
		ieee80211_iterate_active_interfaces_atomic(
			data->hw, IEEE80211_IFACE_ITER_NORMAL,
			hwsim_send_ps_poll, data);
		data->ps_poll_pending = true;
	} else if (old_ps == PS_DISABLED && val != PS_DISABLED) {
		ieee80211_iterate_active_interfaces(data->hw,
						    IEEE80211_IFACE_ITER_NORMAL,
						    hwsim_send_nullfunc_ps,
						    data);
		ieee80211_iterate_active_interfaces_atomic(
			data->hw, IEEE80211_IFACE_ITER_NORMAL,
			hwsim_send_nullfunc_ps, data);
	} else if (old_ps != PS_DISABLED && val == PS_DISABLED) {
		ieee80211_iterate_active_interfaces(data->hw,
						    IEEE80211_IFACE_ITER_NORMAL,
						    hwsim_send_nullfunc_no_ps,
						    data);
		ieee80211_iterate_active_interfaces_atomic(
			data->hw, IEEE80211_IFACE_ITER_NORMAL,
			hwsim_send_nullfunc_no_ps, data);
	}
	local_bh_enable();

	return 0;
}