Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

wil6210: add memory barriers for the reset flow

make sure reset flow executed in order

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>

authored by

Vladimir Kondratiev and committed by
John W. Linville
260e6951 d28bcc30

+6
+6
drivers/net/wireless/ath/wil6210/main.c
··· 289 289 S(RGF_USER_CLKS_CTL_SW_RST_MASK_0, BIT(6)); 290 290 /* car_perst_rst_src_n_mask */ 291 291 S(RGF_USER_CLKS_CTL_SW_RST_MASK_0, BIT(7)); 292 + wmb(); /* order is important here */ 292 293 293 294 W(RGF_USER_MAC_CPU_0, BIT(1)); /* mac_cpu_man_rst */ 294 295 W(RGF_USER_USER_CPU_0, BIT(1)); /* user_cpu_man_rst */ 296 + wmb(); /* order is important here */ 295 297 296 298 W(RGF_USER_CLKS_CTL_SW_RST_VEC_2, 0xFE000000); 297 299 W(RGF_USER_CLKS_CTL_SW_RST_VEC_1, 0x0000003F); 298 300 W(RGF_USER_CLKS_CTL_SW_RST_VEC_3, 0x00000170); 299 301 W(RGF_USER_CLKS_CTL_SW_RST_VEC_0, 0xFFE7FC00); 302 + wmb(); /* order is important here */ 300 303 301 304 W(RGF_USER_CLKS_CTL_SW_RST_VEC_3, 0); 302 305 W(RGF_USER_CLKS_CTL_SW_RST_VEC_2, 0); 303 306 W(RGF_USER_CLKS_CTL_SW_RST_VEC_1, 0); 304 307 W(RGF_USER_CLKS_CTL_SW_RST_VEC_0, 0); 308 + wmb(); /* order is important here */ 305 309 306 310 W(RGF_USER_CLKS_CTL_SW_RST_VEC_3, 0x00000001); 307 311 if (rev_id == 1) { ··· 315 311 W(RGF_USER_CLKS_CTL_SW_RST_VEC_2, 0x00008000); 316 312 } 317 313 W(RGF_USER_CLKS_CTL_SW_RST_VEC_0, 0); 314 + wmb(); /* order is important here */ 318 315 319 316 /* wait until device ready */ 320 317 do { ··· 332 327 W(RGF_PCIE_LOS_COUNTER_CTL, BIT(8)); 333 328 334 329 C(RGF_USER_CLKS_CTL_0, BIT_USER_CLKS_RST_PWGD); 330 + wmb(); /* order is important here */ 335 331 336 332 wil_dbg_misc(wil, "Reset completed in %d ms\n", delay); 337 333