aacadbaf2ff3849585d3aaa64a64026ec553d9bb
[openwrt/svn-archive/archive.git] / package / kernel / mac80211 / patches / 330-ath5k-fix-spontaneus-AR5312-freezes.patch
1 From: Sergey Ryazanov <ryazanov.s.a@gmail.com>
2 Date: Tue, 3 Feb 2015 22:37:26 +0300
3 Subject: [PATCH] ath5k: fix spontaneus AR5312 freezes
4
5 Sometimes while CPU have some load and ath5k doing the wireless
6 interface reset the whole WiSoC completely freezes. Set of tests shows
7 that using atomic delay function while we wait interface reset helps to
8 avoid such freezes.
9
10 The easiest way to reproduce this issue: create a station interface,
11 start continous scan with wpa_supplicant and load CPU by something. Or
12 just create multiple station interfaces and put them all in continous
13 scan.
14
15 This patch partially reverts the commit 1846ac3dbec0 ("ath5k: Use
16 usleep_range where possible"), which replaces initial udelay()
17 by usleep_range().
18
19 I do not know actual source of this issue, but all looks like that HW
20 freeze is caused by transaction on internal SoC bus, while wireless
21 block is in reset state.
22
23 Also I should note that I do not know how many chips are affected, but I
24 did not see this issue with chips, other than AR5312.
25
26 CC: Jiri Slaby <jirislaby@gmail.com>
27 CC: Nick Kossifidis <mickflemm@gmail.com>
28 CC: Luis R. Rodriguez <mcgrof@do-not-panic.com>
29 Fixes: 1846ac3dbec0 ("ath5k: Use usleep_range where possible")
30 Reported-by: Christophe Prevotaux <c.prevotaux@rural-networks.com>
31 Tested-by: Christophe Prevotaux <c.prevotaux@rural-networks.com>
32 Tested-by: Eric Bree <ebree@nltinc.com>
33 Signed-off-by: Sergey Ryazanov <ryazanov.s.a@gmail.com>
34 ---
35 --- a/drivers/net/wireless/ath/ath5k/reset.c
36 +++ b/drivers/net/wireless/ath/ath5k/reset.c
37 @@ -478,7 +478,7 @@ ath5k_hw_wisoc_reset(struct ath5k_hw *ah
38 regval = ioread32(reg);
39 iowrite32(regval | val, reg);
40 regval = ioread32(reg);
41 - usleep_range(100, 150);
42 + udelay(100); /* NB: should be atomic */
43
44 /* Bring BB/MAC out of reset */
45 iowrite32(regval & ~val, reg);