From 1119d9ca844de0dd4b188e4b3a0fa2f6eebed081 Mon Sep 17 00:00:00 2001 From: avishad verma Date: Tue, 9 Jan 2024 06:23:42 -0600 Subject: [PATCH 276/296] brcmfmac: Unexpected failure errors are seen during driver load While insmod FW Control switch from Bootloader to RAM. During this transition console buffer address is not valid. Skip reading console logs if address is 0. Signed-off-by: avishad verma --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c index 57f5a69db2da..a587bcbc63d6 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c @@ -3511,6 +3511,14 @@ static int brcmf_sdio_readconsole(struct brcmf_sdio *bus) /* Read the console buffer */ addr = le32_to_cpu(c->log_le.buf); + + /* During FW Control Switch from Bootloader to Ram + * Console address read will return all 0's which is not a valid. + * when we try to access 0 ram address we are getting SDIO error. + */ + if (addr == 0) + return 0; + rv = brcmf_sdiod_ramrw(bus->sdiodev, false, addr, c->buf, c->bufsize); if (rv < 0) return rv; -- 2.25.1