mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2] wlcore: sdio: Rate limit wl12xx_sdio_raw_{read,write}() failures warns
@ 2024-02-28 10:10 Javier Martinez Canillas
  2024-03-05 18:53 ` [v2] wifi: " Kalle Valo
  0 siblings, 1 reply; 2+ messages in thread
From: Javier Martinez Canillas @ 2024-02-28 10:10 UTC (permalink / raw)
  To: linux-kernel
  Cc: Nishanth Menon, Javier Martinez Canillas, Breno Leitao,
	Kalle Valo, Li Zetao, linux-wireless

When these failures happen, the warning and call trace is printed which is
excessive. Instead, just print the error but rate limited to prevent warns
to unnecessarily pollute the kernel log buffer and make the serial console
practically unusable.

For example, on an AM625 BeaglePlay board where accessing a SDIO WiFi chip
fails with an -110 (ETIMEDOUT) error:

  $ dmesg | grep "sdio write\|read failed (-110)" | wc -l
  39

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Breno Leitao <leitao@debian.org>
---

Changes in v2:
- Add Reviewed-by tag by Breno Leitao.
- Drop warns which seems excesive and rate limit the error (Kalle Vallo).

 drivers/net/wireless/ti/wlcore/sdio.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/ti/wlcore/sdio.c b/drivers/net/wireless/ti/wlcore/sdio.c
index eb5482ed76ae..70b9648acaaf 100644
--- a/drivers/net/wireless/ti/wlcore/sdio.c
+++ b/drivers/net/wireless/ti/wlcore/sdio.c
@@ -75,8 +75,8 @@ static int __must_check wl12xx_sdio_raw_read(struct device *child, int addr,
 
 	sdio_release_host(func);
 
-	if (WARN_ON(ret))
-		dev_err(child->parent, "sdio read failed (%d)\n", ret);
+	if (ret)
+		dev_err_ratelimited(child->parent, "sdio read failed (%d)\n", ret);
 
 	if (unlikely(dump)) {
 		printk(KERN_DEBUG "wlcore_sdio: READ from 0x%04x\n", addr);
@@ -120,8 +120,8 @@ static int __must_check wl12xx_sdio_raw_write(struct device *child, int addr,
 
 	sdio_release_host(func);
 
-	if (WARN_ON(ret))
-		dev_err(child->parent, "sdio write failed (%d)\n", ret);
+	if (ret)
+		dev_err_ratelimited(child->parent, "sdio write failed (%d)\n", ret);
 
 	return ret;
 }
-- 
2.43.2


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

* Re: [v2] wifi: wlcore: sdio: Rate limit wl12xx_sdio_raw_{read,write}() failures warns
  2024-02-28 10:10 [PATCH v2] wlcore: sdio: Rate limit wl12xx_sdio_raw_{read,write}() failures warns Javier Martinez Canillas
@ 2024-03-05 18:53 ` Kalle Valo
  0 siblings, 0 replies; 2+ messages in thread
From: Kalle Valo @ 2024-03-05 18:53 UTC (permalink / raw)
  To: Javier Martinez Canillas
  Cc: linux-kernel, Nishanth Menon, Javier Martinez Canillas,
	Breno Leitao, Li Zetao, linux-wireless

Javier Martinez Canillas <javierm@redhat.com> wrote:

> When these failures happen, the warning and call trace is printed which is
> excessive. Instead, just print the error but rate limited to prevent warns
> to unnecessarily pollute the kernel log buffer and make the serial console
> practically unusable.
> 
> For example, on an AM625 BeaglePlay board where accessing a SDIO WiFi chip
> fails with an -110 (ETIMEDOUT) error:
> 
>   $ dmesg | grep "sdio write\|read failed (-110)" | wc -l
>   39
> 
> Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
> Reviewed-by: Breno Leitao <leitao@debian.org>

Patch applied to wireless-next.git, thanks.

f6e36d9e1c63 wifi: wlcore: sdio: Rate limit wl12xx_sdio_raw_{read,write}() failures warns

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20240228101042.728881-1-javierm@redhat.com/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


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

end of thread, other threads:[~2024-03-05 18:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-28 10:10 [PATCH v2] wlcore: sdio: Rate limit wl12xx_sdio_raw_{read,write}() failures warns Javier Martinez Canillas
2024-03-05 18:53 ` [v2] wifi: " Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®