[PATCH 2/3] staging: brcm80211: removed locks around Mac80211 calls

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



A spinlock was acquired prior to calling the Mac80211 functions
ieee80211_wake_queues() and ieee80211_stop_queues() and Cfg80211 functions
wiphy_rfkill_set_hw_state() and wiphy_rfkill_start_polling().
This is not required and could even lead to instability. Therefore the locks
were removed.

Signed-off-by: Roland Vossen <rvossen@xxxxxxxxxxxx>
Reviewed-by:   Arend van Spriel <arend@xxxxxxxxxxxx>
Reviewed-by:   Brett Rudley <brudley@xxxxxxxxxxxx>
---
 drivers/staging/brcm80211/brcmsmac/wl_mac80211.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmsmac/wl_mac80211.c b/drivers/staging/brcm80211/brcmsmac/wl_mac80211.c
index 3109e3d..791329c 100644
--- a/drivers/staging/brcm80211/brcmsmac/wl_mac80211.c
+++ b/drivers/staging/brcm80211/brcmsmac/wl_mac80211.c
@@ -171,9 +171,7 @@ static int wl_ops_start(struct ieee80211_hw *hw)
 	  WL_NONE("%s : Initial channel: %d\n", __func__, curchan->hw_value);
 	*/
 
-	WL_LOCK(wl);
 	ieee80211_wake_queues(hw);
-	WL_UNLOCK(wl);
 	blocked = wl_rfkill_set_hw_state(wl);
 	if (!blocked)
 		wiphy_rfkill_stop_polling(wl->pub->ieee_hw->wiphy);
@@ -185,9 +183,8 @@ static void wl_ops_stop(struct ieee80211_hw *hw)
 {
 	struct wl_info *wl = hw->priv;
 	ASSERT(wl);
-	WL_LOCK(wl);
 	ieee80211_stop_queues(hw);
-	WL_UNLOCK(wl);
+	return;
 }
 
 static int
@@ -1988,8 +1985,10 @@ bool wl_rfkill_set_hw_state(struct wl_info *wl)
 
 	WL_NONE("%s: update hw state: blocked=%s\n", __func__,
 		blocked ? "true" : "false");
+	WL_UNLOCK(wl);
 	wiphy_rfkill_set_hw_state(wl->pub->ieee_hw->wiphy, blocked);
 	if (blocked)
 		wiphy_rfkill_start_polling(wl->pub->ieee_hw->wiphy);
+	WL_LOCK(wl);
 	return blocked;
 }
-- 
1.7.1


_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux