summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/ath/wil6210
diff options
context:
space:
mode:
authorVladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>2014-08-06 10:31:50 +0300
committerJohn W. Linville <linville@tuxdriver.com>2014-08-25 16:17:30 -0400
commitcc9e4a2b667c79d531a79c5eede27d11c1394326 (patch)
tree827767fd782e275bf5ed4195def9792194eb7235 /drivers/net/wireless/ath/wil6210
parent91b775edf7ad54f849895e021677f7d9c15a9f5d (diff)
wil6210: fix race in reset
It is important to halt USER CPU first, then MAC CPU Otherwise, race happens in the firmware Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/wil6210')
-rw-r--r--drivers/net/wireless/ath/wil6210/main.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath/wil6210/main.c b/drivers/net/wireless/ath/wil6210/main.c
index 3704d2a434f3..d73428303621 100644
--- a/drivers/net/wireless/ath/wil6210/main.c
+++ b/drivers/net/wireless/ath/wil6210/main.c
@@ -327,6 +327,8 @@ static void wil_target_reset(struct wil6210_priv *wil)
/* register clear = read, AND with inverted, write */
#define C(a, v) W(a, R(a) & ~v)
+ wmb(); /* If host reorder writes here -> race in NIC */
+ W(RGF_USER_MAC_CPU_0, BIT(1)); /* mac_cpu_man_rst */
wil->hw_version = R(RGF_USER_FW_REV_ID);
rev_id = wil->hw_version & 0xff;
@@ -343,8 +345,9 @@ static void wil_target_reset(struct wil6210_priv *wil)
wmb(); /* order is important here */
}
- W(RGF_USER_MAC_CPU_0, BIT(1)); /* mac_cpu_man_rst */
W(RGF_USER_USER_CPU_0, BIT(1)); /* user_cpu_man_rst */
+ wmb(); /* If host reorder writes here -> race in NIC */
+ W(RGF_USER_MAC_CPU_0, BIT(1)); /* mac_cpu_man_rst */
wmb(); /* order is important here */
W(RGF_USER_CLKS_CTL_SW_RST_VEC_2, 0xFE000000);