summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/ralink/rt2x00/rt2x00mac.c
diff options
context:
space:
mode:
authorStanislaw Gruszka <sgruszka@redhat.com>2016-12-19 13:52:57 +0300
committerKalle Valo <kvalo@codeaurora.org>2016-12-30 15:03:41 +0300
commitc7d1c77781f468c639867d324d4e490139cd4c7f (patch)
tree0800a783adfbd65b30a42d2bd91e59a759a91f33 /drivers/net/wireless/ralink/rt2x00/rt2x00mac.c
parent31369c323ba0dc839d8a4e5a5727adc76814959c (diff)
downloadlinux-c7d1c77781f468c639867d324d4e490139cd4c7f.tar.xz
rt2x00: add mutex to synchronize config and link tuner
Do not perform mac80211 config and link_tuner at the same time, this can possibly result in wrong RF or BBP configuration. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/ralink/rt2x00/rt2x00mac.c')
-rw-r--r--drivers/net/wireless/ralink/rt2x00/rt2x00mac.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/wireless/ralink/rt2x00/rt2x00mac.c b/drivers/net/wireless/ralink/rt2x00/rt2x00mac.c
index d4b50fb948ee..3cc1384ed2fc 100644
--- a/drivers/net/wireless/ralink/rt2x00/rt2x00mac.c
+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00mac.c
@@ -320,6 +320,9 @@ int rt2x00mac_config(struct ieee80211_hw *hw, u32 changed)
*/
rt2x00queue_stop_queue(rt2x00dev->rx);
+ /* Do not race with with link tuner. */
+ mutex_lock(&rt2x00dev->conf_mutex);
+
/*
* When we've just turned on the radio, we want to reprogram
* everything to ensure a consistent state
@@ -335,6 +338,8 @@ int rt2x00mac_config(struct ieee80211_hw *hw, u32 changed)
*/
rt2x00lib_config_antenna(rt2x00dev, rt2x00dev->default_ant);
+ mutex_unlock(&rt2x00dev->conf_mutex);
+
/* Turn RX back on */
rt2x00queue_start_queue(rt2x00dev->rx);