* [PATCH] wlcore: sdio: warn only once for wl12xx_sdio_raw_{read,write}() failures
@ 2024-02-27 0:20 Javier Martinez Canillas
2024-02-27 11:29 ` Breno Leitao
2024-02-27 20:58 ` Kalle Valo
0 siblings, 2 replies; 4+ messages in thread
From: Javier Martinez Canillas @ 2024-02-27 0:20 UTC (permalink / raw)
To: linux-kernel
Cc: Nishanth Menon, Javier Martinez Canillas, Breno Leitao,
Kalle Valo, Li Zetao, linux-wireless
Report these failures only once, instead of keep logging the warnings for
the same condition every time that a SDIO read or write is attempted. This
behaviour is spammy and unnecessarily pollutes the kernel log buffer.
For example, on an AM625 BeaglePlay board where accessing a SDIO WiFi chip
fails with an -110 error:
$ dmesg | grep "sdio write\|read failed (-110)" | wc -l
39
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
---
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..47ecf33a0fbe 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 (WARN_ON_ONCE(ret))
+ dev_err_once(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 (WARN_ON_ONCE(ret))
+ dev_err_once(child->parent, "sdio write failed (%d)\n", ret);
return ret;
}
--
2.43.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] wlcore: sdio: warn only once for wl12xx_sdio_raw_{read,write}() failures
2024-02-27 0:20 [PATCH] wlcore: sdio: warn only once for wl12xx_sdio_raw_{read,write}() failures Javier Martinez Canillas
@ 2024-02-27 11:29 ` Breno Leitao
2024-02-27 20:58 ` Kalle Valo
1 sibling, 0 replies; 4+ messages in thread
From: Breno Leitao @ 2024-02-27 11:29 UTC (permalink / raw)
To: Javier Martinez Canillas
Cc: linux-kernel, Nishanth Menon, Kalle Valo, Li Zetao,
linux-wireless
On Tue, Feb 27, 2024 at 01:20:46AM +0100, Javier Martinez Canillas wrote:
> Report these failures only once, instead of keep logging the warnings for
> the same condition every time that a SDIO read or write is attempted. This
> behaviour is spammy and unnecessarily pollutes the kernel log buffer.
>
> For example, on an AM625 BeaglePlay board where accessing a SDIO WiFi chip
> fails with an -110 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>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] wlcore: sdio: warn only once for wl12xx_sdio_raw_{read,write}() failures
2024-02-27 0:20 [PATCH] wlcore: sdio: warn only once for wl12xx_sdio_raw_{read,write}() failures Javier Martinez Canillas
2024-02-27 11:29 ` Breno Leitao
@ 2024-02-27 20:58 ` Kalle Valo
2024-02-28 8:24 ` Javier Martinez Canillas
1 sibling, 1 reply; 4+ messages in thread
From: Kalle Valo @ 2024-02-27 20:58 UTC (permalink / raw)
To: Javier Martinez Canillas
Cc: linux-kernel, Nishanth Menon, Breno Leitao, Li Zetao,
linux-wireless
Javier Martinez Canillas <javierm@redhat.com> writes:
> Report these failures only once, instead of keep logging the warnings for
> the same condition every time that a SDIO read or write is attempted. This
> behaviour is spammy and unnecessarily pollutes the kernel log buffer.
Removing error messages is not usually a good idea, it would be much
better to fix the root cause.
> For example, on an AM625 BeaglePlay board where accessing a SDIO WiFi chip
> fails with an -110 error:
>
> $ dmesg | grep "sdio write\|read failed (-110)" | wc -l
> 39
-110 is -ETIMEDOUT. Why is it timing out?
> Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
> ---
>
> 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..47ecf33a0fbe 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 (WARN_ON_ONCE(ret))
> + dev_err_once(child->parent, "sdio read failed (%d)\n", ret);
WARN_ON() feels excessive here, maybe remove that entirely? But
dev_err_ratelimited() feels more approriate than printing the error just
once.
--
https://patchwork.kernel.org/project/linux-wireless/list/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] wlcore: sdio: warn only once for wl12xx_sdio_raw_{read,write}() failures
2024-02-27 20:58 ` Kalle Valo
@ 2024-02-28 8:24 ` Javier Martinez Canillas
0 siblings, 0 replies; 4+ messages in thread
From: Javier Martinez Canillas @ 2024-02-28 8:24 UTC (permalink / raw)
To: Kalle Valo
Cc: linux-kernel, Nishanth Menon, Breno Leitao, Li Zetao,
linux-wireless
Kalle Valo <kvalo@kernel.org> writes:
Hello Kalle,
Thanks for your feedback.
> Javier Martinez Canillas <javierm@redhat.com> writes:
>
>> Report these failures only once, instead of keep logging the warnings for
>> the same condition every time that a SDIO read or write is attempted. This
>> behaviour is spammy and unnecessarily pollutes the kernel log buffer.
>
> Removing error messages is not usually a good idea, it would be much
This patch is not removing error messages though, just limiting to print
only since IMO there is no need to constantly keep printing the same error
message over and over.
> better to fix the root cause.
>
Agreed and I'm trying to figure out the cause. But to do that, I need a
usable serial console and it's barely usable with all the warns and stack
traces printed while I'm trying to type commands.
>> For example, on an AM625 BeaglePlay board where accessing a SDIO WiFi chip
>> fails with an -110 error:
>>
>> $ dmesg | grep "sdio write\|read failed (-110)" | wc -l
>> 39
>
> -110 is -ETIMEDOUT. Why is it timing out?
>
If I knew it then I wouldn't have to type this patch :) In theory it
should work according to Nishanth (Cc'ed) since I've both the firmware
and the required patches for the bootloader to set some clocks early.
But it's not working for me... I don't know what's missing for me.
>> Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
[...]
>> - if (WARN_ON(ret))
>> - dev_err(child->parent, "sdio read failed (%d)\n", ret);
>> + if (WARN_ON_ONCE(ret))
>> + dev_err_once(child->parent, "sdio read failed (%d)\n", ret);
>
> WARN_ON() feels excessive here, maybe remove that entirely? But
Agreed and I'm on board to drop it.
> dev_err_ratelimited() feels more approriate than printing the error just
> once.
>
Works for me. Thanks!
--
Best regards,
Javier Martinez Canillas
Core Platforms
Red Hat
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-02-28 8:24 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-27 0:20 [PATCH] wlcore: sdio: warn only once for wl12xx_sdio_raw_{read,write}() failures Javier Martinez Canillas
2024-02-27 11:29 ` Breno Leitao
2024-02-27 20:58 ` Kalle Valo
2024-02-28 8:24 ` Javier Martinez Canillas
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).