ath5k: fix spontaneus AR5312 freezes
ath5k: fix spontaneus AR5312 freezes

Sometimes while CPU have some load and ath5k doing the wireless
interface reset the whole WiSoC completely freezes. Set of tests shows
that using atomic delay function while we wait interface reset helps to
avoid such freezes.

The easiest way to reproduce this issue: create a station interface,
start continous scan with wpa_supplicant and load CPU by something. Or
just create multiple station interfaces and put them all in continous
scan.

This patch partially reverts the commit 1846ac3dbec0 ("ath5k: Use
usleep_range where possible"), which replaces initial udelay()
by usleep_range().

I do not know actual source of this issue, but all looks like that HW
freeze is caused by transaction on internal SoC bus, while wireless
block is in reset state.

Also I should note that I do not know how many chips are affected, but I
did not see this issue with chips, other than AR5312.

CC: Jiri Slaby <aeaaaa09d9a5fac7c38743ea79aa4bb8ffb08290@gmail.com>
CC: Nick Kossifidis <bd5bb29faf6bf0846d00f1a7315d9bcc5d451bce@gmail.com>
CC: Luis R. Rodriguez <d4fa18192c5a479e564d29c2300c2e15afd1d8d7@do-not-panic.com>
Fixes: 1846ac3dbec0 ("ath5k: Use usleep_range where possible")
Reported-by: Christophe Prevotaux <cca0eb5a88b1be94e5b2ef7b59df761b48819453@rural-networks.com>
Tested-by: Christophe Prevotaux <cca0eb5a88b1be94e5b2ef7b59df761b48819453@rural-networks.com>
Tested-by: Eric Bree <b216d3a02928378faadaca0ceb915ca1aab30dc1@nltinc.com>
Signed-off-by: Sergey Ryazanov <423a5bacc5a2db867b163d28c7ddd6779713feca@gmail.com>
Signed-off-by: Kalle Valo <7081a7d99b8c74c0698a728df19e3915a995d7e1@codeaurora.org>

KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs