mac80211: brcmfmac: restructuring sdio access functions
[openwrt/openwrt.git] / package / kernel / mac80211 / patches / 311-v4.16-0006-brcmfmac-Remove-bandaid-for-SleepCSR.patch
1 From 4a3338ba2a7421db2260159cca5a27bd2ee36d00 Mon Sep 17 00:00:00 2001
2 From: Ian Molton <ian@mnementh.co.uk>
3 Date: Mon, 13 Nov 2017 21:35:43 +0100
4 Subject: [PATCH] brcmfmac: Remove bandaid for SleepCSR
5
6 Register access code is not the place for band-aid fixes like this.
7 If this is a genuine problem, it should be fixed further up in the driver
8 stack.
9
10 Signed-off-by: Ian Molton <ian@mnementh.co.uk>
11 Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
12 Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
13 ---
14 .../wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 28 +---------------------
15 1 file changed, 1 insertion(+), 27 deletions(-)
16
17 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
18 +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
19 @@ -334,21 +334,8 @@ static int brcmf_sdiod_reg_write(struct
20 } while (ret != 0 && ret != -ENOMEDIUM &&
21 retry++ < SDIOH_API_ACCESS_RETRY_LIMIT);
22
23 - if (ret == -ENOMEDIUM) {
24 + if (ret == -ENOMEDIUM)
25 brcmf_sdiod_change_state(sdiodev, BRCMF_SDIOD_NOMEDIUM);
26 - } else if (ret != 0) {
27 - /*
28 - * SleepCSR register access can fail when
29 - * waking up the device so reduce this noise
30 - * in the logs.
31 - */
32 - if (addr != SBSDIO_FUNC1_SLEEPCSR)
33 - brcmf_err("failed to write data F%d@0x%05x, err: %d\n",
34 - func, addr, ret);
35 - else
36 - brcmf_dbg(SDIO, "failed to write data F%d@0x%05x, err: %d\n",
37 - func, addr, ret);
38 - }
39
40 return ret;
41 }
42 @@ -389,19 +376,6 @@ static int brcmf_sdiod_reg_read(struct b
43
44 if (ret == -ENOMEDIUM)
45 brcmf_sdiod_change_state(sdiodev, BRCMF_SDIOD_NOMEDIUM);
46 - else if (ret != 0) {
47 - /*
48 - * SleepCSR register access can fail when
49 - * waking up the device so reduce this noise
50 - * in the logs.
51 - */
52 - if (addr != SBSDIO_FUNC1_SLEEPCSR)
53 - brcmf_err("failed to read data F%d@0x%05x, err: %d\n",
54 - func, addr, ret);
55 - else
56 - brcmf_dbg(SDIO, "failed to read data F%d@0x%05x, err: %d\n",
57 - func, addr, ret);
58 - }
59
60 return ret;
61 }