[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190603183740.239031-4-dianders@chromium.org>
Date: Mon, 3 Jun 2019 11:37:40 -0700
From: Douglas Anderson <dianders@...omium.org>
To: Ulf Hansson <ulf.hansson@...aro.org>,
Kalle Valo <kvalo@...eaurora.org>,
Adrian Hunter <adrian.hunter@...el.com>,
Arend van Spriel <arend.vanspriel@...adcom.com>
Cc: brcm80211-dev-list.pdl@...adcom.com,
linux-rockchip@...ts.infradead.org,
Double Lo <double.lo@...ress.com>, briannorris@...omium.org,
linux-wireless@...r.kernel.org,
Naveen Gupta <naveen.gupta@...ress.com>,
Madhan Mohan R <madhanmohan.r@...ress.com>, mka@...omium.org,
Wright Feng <wright.feng@...ress.com>,
Chi-Hsien Lin <chi-hsien.lin@...ress.com>,
netdev@...r.kernel.org, brcm80211-dev-list@...ress.com,
Douglas Anderson <dianders@...omium.org>,
"David S. Miller" <davem@...emloft.net>,
Franky Lin <franky.lin@...adcom.com>,
linux-kernel@...r.kernel.org,
Hante Meuleman <hante.meuleman@...adcom.com>,
YueHaibing <yuehaibing@...wei.com>,
Michael Trimarchi <michael@...rulasolutions.com>
Subject: [PATCH v2 3/3] brcmfmac: sdio: Disable auto-tuning around commands expected to fail
There are certain cases, notably when transitioning between sleep and
active state, when Broadcom SDIO WiFi cards will produce errors on the
SDIO bus. This is evident from the source code where you can see that
we try commands in a loop until we either get success or we've tried
too many times. The comment in the code reinforces this by saying
"just one write attempt may fail"
Unfortunately these failures sometimes end up causing an "-EILSEQ"
back to the core which triggers a retuning of the SDIO card and that
blocks all traffic to the card until it's done.
Let's disable retuning around the commands we expect might fail.
Fixes: bd11e8bd03ca ("mmc: core: Flag re-tuning is needed on CRC errors")
Signed-off-by: Douglas Anderson <dianders@...omium.org>
---
Changes in v2: None
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
index 4a750838d8cd..e0cfcc078a54 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
@@ -16,6 +16,7 @@
#include <linux/mmc/sdio_ids.h>
#include <linux/mmc/sdio_func.h>
#include <linux/mmc/card.h>
+#include <linux/mmc/core.h>
#include <linux/semaphore.h>
#include <linux/firmware.h>
#include <linux/module.h>
@@ -697,6 +698,7 @@ brcmf_sdio_kso_control(struct brcmf_sdio *bus, bool on)
bmask = SBSDIO_FUNC1_SLEEPCSR_KSO_MASK;
}
+ mmc_expect_errors_begin(bus->sdiodev->func1->card->host);
do {
/* reliable KSO bit set/clr:
* the sdiod sleep write access is synced to PMU 32khz clk
@@ -719,6 +721,7 @@ brcmf_sdio_kso_control(struct brcmf_sdio *bus, bool on)
&err);
} while (try_cnt++ < MAX_KSO_ATTEMPTS);
+ mmc_expect_errors_end(bus->sdiodev->func1->card->host);
if (try_cnt > 2)
brcmf_dbg(SDIO, "try_cnt=%d rd_val=0x%x err=%d\n", try_cnt,
--
2.22.0.rc1.311.g5d7573a151-goog
Powered by blists - more mailing lists