All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kalle Valo <kvalo@kernel.org>
To: Javier Martinez Canillas <javierm@redhat.com>
Cc: linux-kernel@vger.kernel.org,  Nishanth Menon <nm@ti.com>,
	 Breno Leitao <leitao@debian.org>,
	 Li Zetao <lizetao1@huawei.com>,
	linux-wireless@vger.kernel.org
Subject: Re: [PATCH] wlcore: sdio: warn only once for wl12xx_sdio_raw_{read,write}() failures
Date: Tue, 27 Feb 2024 22:58:18 +0200	[thread overview]
Message-ID: <8734tdaal1.fsf@kernel.org> (raw)
In-Reply-To: <20240227002059.379267-1-javierm@redhat.com> (Javier Martinez Canillas's message of "Tue, 27 Feb 2024 01:20:46 +0100")

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

  parent reply	other threads:[~2024-02-27 20:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2024-02-28  8:24   ` Javier Martinez Canillas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8734tdaal1.fsf@kernel.org \
    --to=kvalo@kernel.org \
    --cc=javierm@redhat.com \
    --cc=leitao@debian.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=lizetao1@huawei.com \
    --cc=nm@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.