提交 cc9e4a2b 编写于 作者: V Vladimir Kondratiev 提交者: John W. Linville

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: NVladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 91b775ed
...@@ -327,6 +327,8 @@ static void wil_target_reset(struct wil6210_priv *wil) ...@@ -327,6 +327,8 @@ static void wil_target_reset(struct wil6210_priv *wil)
/* register clear = read, AND with inverted, write */ /* register clear = read, AND with inverted, write */
#define C(a, v) W(a, R(a) & ~v) #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); wil->hw_version = R(RGF_USER_FW_REV_ID);
rev_id = wil->hw_version & 0xff; rev_id = wil->hw_version & 0xff;
...@@ -343,8 +345,9 @@ static void wil_target_reset(struct wil6210_priv *wil) ...@@ -343,8 +345,9 @@ static void wil_target_reset(struct wil6210_priv *wil)
wmb(); /* order is important here */ 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 */ 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 */ wmb(); /* order is important here */
W(RGF_USER_CLKS_CTL_SW_RST_VEC_2, 0xFE000000); W(RGF_USER_CLKS_CTL_SW_RST_VEC_2, 0xFE000000);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册