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

Commit 8910cfa3 authored by Arik Nemtsov's avatar Arik Nemtsov Committed by Luciano Coelho
Browse files

wlcore: change warn on missing lock in wlcore_queue_xx funcs



On !CONFIG_SMP builds spin_is_locked always returns 0. Assert the
locking using assert_spin_locked, which is written to behave correctly
in all cases.

Signed-off-by: default avatarArik Nemtsov <arik@wizery.com>
Signed-off-by: default avatarLuciano Coelho <coelho@ti.com>
parent 0a9ffac0
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/etherdevice.h>
#include <linux/spinlock.h>

#include "wlcore.h"
#include "debug.h"
@@ -1289,7 +1290,7 @@ bool wlcore_is_queue_stopped_by_reason_locked(struct wl1271 *wl,
{
	int hwq = wlcore_tx_get_mac80211_queue(wlvif, queue);

	WARN_ON_ONCE(!spin_is_locked(&wl->wl_lock));
	assert_spin_locked(&wl->wl_lock);
	return test_bit(reason, &wl->queue_stop_reasons[hwq]);
}

@@ -1298,6 +1299,6 @@ bool wlcore_is_queue_stopped_locked(struct wl1271 *wl, struct wl12xx_vif *wlvif,
{
	int hwq = wlcore_tx_get_mac80211_queue(wlvif, queue);

	WARN_ON_ONCE(!spin_is_locked(&wl->wl_lock));
	assert_spin_locked(&wl->wl_lock);
	return !!wl->queue_stop_reasons[hwq];
}