Skip to contentSkip to conversation

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

PATCH In review Javier Martinez Canillas 2 participants 2 messages Feb 28, 2024 – Mar 5, 2024 TI wilink wireless drivers

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 wlcore: sdio: Rate limit wl12xx_sdio_raw_{read,write}() failures warns

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

---

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(-)
drivers/net/wireless/ti/wlcore/sdio.c +4 -4
index eb5482ed76ae..70b9648acaaf 100644
@@ -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;
 }
Signature · 1 line
2.43.2
#1 lore raw

Re: [v2] wifi: wlcore: sdio: Rate limit wl12xx_sdio_raw_{read,write}() failures warns

Quoted 5 lines · Javier Martinez Canillas

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.

Quoted 8 lines

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

Patch applied to wireless-next.git, thanks.

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

Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/

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