linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RESEND] brcmfmac: Add an error log for brcmf_sdiod_ramrw()
@ 2025-04-14  7:42 Wentao Liang
  2025-04-14  9:28 ` Arend van Spriel
  2025-07-23  8:24 ` Arend van Spriel
  0 siblings, 2 replies; 3+ messages in thread
From: Wentao Liang @ 2025-04-14  7:42 UTC (permalink / raw)
  To: arend.vanspriel
  Cc: kvalo, sebastian.reichel, erick.archer, megi, linux-wireless,
	brcm80211, brcm80211-dev-list.pdl, linux-kernel, Wentao Liang

The function brcmf_sdio_buscore_activate() calls the function
brcmf_sdiod_ramrw(), but does not check its return value. Log
the error message to prevent silent failure if the function fails.

Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
---
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
index b1727f35217b..dd683c2582fb 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
@@ -3898,8 +3898,9 @@ static void brcmf_sdio_buscore_activate(void *ctx, struct brcmf_chip *chip,
 
 	if (rstvec)
 		/* Write reset vector to address 0 */
-		brcmf_sdiod_ramrw(sdiodev, true, 0, (void *)&rstvec,
-				  sizeof(rstvec));
+		if (brcmf_sdiod_ramrw(sdiodev, true, 0, (void *)&rstvec,
+				      sizeof(rstvec)) < 0)
+			brcmf_err("Fail to reset vector\n");
 }
 
 static u32 brcmf_sdio_buscore_read32(void *ctx, u32 addr)
-- 
2.42.0.windows.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH RESEND] brcmfmac: Add an error log for brcmf_sdiod_ramrw()
  2025-04-14  7:42 [PATCH RESEND] brcmfmac: Add an error log for brcmf_sdiod_ramrw() Wentao Liang
@ 2025-04-14  9:28 ` Arend van Spriel
  2025-07-23  8:24 ` Arend van Spriel
  1 sibling, 0 replies; 3+ messages in thread
From: Arend van Spriel @ 2025-04-14  9:28 UTC (permalink / raw)
  To: Wentao Liang
  Cc: kvalo, sebastian.reichel, erick.archer, megi, linux-wireless,
	brcm80211, brcm80211-dev-list.pdl, linux-kernel

On 4/14/2025 9:42 AM, Wentao Liang wrote:
> The function brcmf_sdio_buscore_activate() calls the function
> brcmf_sdiod_ramrw(), but does not check its return value. Log
> the error message to prevent silent failure if the function fails.

If the reset vector can not be written to device memory the firmware 
will not start and we get a probe failure. While it seems useful to log 
the error I suspect that the MMC/SDIO subsystem will also provide some 
feedback when we can not access the memory on the device (SDIO CMD52 
failure). Oh, well.

Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
> Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
> ---
>   drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH RESEND] brcmfmac: Add an error log for brcmf_sdiod_ramrw()
  2025-04-14  7:42 [PATCH RESEND] brcmfmac: Add an error log for brcmf_sdiod_ramrw() Wentao Liang
  2025-04-14  9:28 ` Arend van Spriel
@ 2025-07-23  8:24 ` Arend van Spriel
  1 sibling, 0 replies; 3+ messages in thread
From: Arend van Spriel @ 2025-07-23  8:24 UTC (permalink / raw)
  To: Wentao Liang
  Cc: kvalo, sebastian.reichel, erick.archer, megi, linux-wireless,
	brcm80211, brcm80211-dev-list.pdl, linux-kernel

On 4/14/2025 9:42 AM, Wentao Liang wrote:
> The function brcmf_sdio_buscore_activate() calls the function
> brcmf_sdiod_ramrw(), but does not check its return value. Log
> the error message to prevent silent failure if the function fails.

Johannes delegated this to me in patchwork so catching up on what was 
already forgotten. Sorry about that.

The likelihood that writing the reset vector in device memory fails is 
next to nothing, because this step is done after we have written the 
firmware and nvram into device memory. Any issue accessing device memory 
would have cause a failure in those steps. So I suggest to drop this patch.

Regards,
Arend

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-07-23  8:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-14  7:42 [PATCH RESEND] brcmfmac: Add an error log for brcmf_sdiod_ramrw() Wentao Liang
2025-04-14  9:28 ` Arend van Spriel
2025-07-23  8:24 ` Arend van Spriel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).