Message ID | 20240227002059.379267-1-javierm@redhat.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-82461-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp2409652dyb; Mon, 26 Feb 2024 16:21:41 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCU6QtkWYurSzhMNQO+/h/3viYQb97bixRhh/fssdFdDxJdAc8d9J5pavL0qFlxamHUyNAPuQ4aFuI7sfnXQRaPGvNOI+w== X-Google-Smtp-Source: AGHT+IERrD3249anm9iTchVvjzO7vprrVOdSVXvrinbIfwMuzyT28r8HSFxL12NlEkb+p3JgFoEL X-Received: by 2002:a05:6a00:22c8:b0:6e5:3edd:5510 with SMTP id f8-20020a056a0022c800b006e53edd5510mr2764605pfj.17.1708993301414; Mon, 26 Feb 2024 16:21:41 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708993301; cv=pass; d=google.com; s=arc-20160816; b=KTl1RPKI+ZIgPcbvIlSmB1EHMIKfKqy+KnC/35QvXFP4qG/ZNvrxdhtoSh/mKAXi9f h8WgneVgvRTpqxgEq/WQ6YKL240fhCatpAv8ktpgrDK/lSHY2CHbknBXOdBcjrgqsxWA jQnPgSNTSQvZMj45ec0z1CfldYbeIsHnMhZidTk9LRYucnsPwqAqM+Tcs11SYMgtp82w Sj1iucLX1LiJBYZbZw8Nd1l1PYu5Ew0ItuXMNNp4ZkMyujELSnGvqcrfgRxMDl8ig3GX HDiZ8s6jBwJhvJNcWMZ9vHGvTcNWktphAxpN0LE2mBVG9T8WNA0L2RLVI1/FNdGj0o5Y IRug== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=deu2WpFSMCIwa7mbcBS0LlHiNgXZ/4WozKcv0iuRKBQ=; fh=X+yp3niVi1D69djZyebvWB8mmH4iyK3YRnqhmBAtgUE=; b=mzPaHm+y+Pemf9PJTX9Lo6Pl4EEBs3ZQZY2VP88cQ5IOqd9DvnlQj3joFu9+TtBnln ZxrhAoG4lcEzLpxCYnNHmSe2S+igb//mzAED11FibufIzndHTIrMpMUi1tImLVRPkaPh lnC+2VwRJRJkcUTn1lFMKDJD6++iR27T8ozZY+Eda2624nTpxPB499e9ysTz/t86VFr8 4uNCNtjcyW0szfiptGSNTfGBLSYZ990zqhBJS4uuqQ6VTeOcLFZ5unDd9FOvAtNMYnyt HTfsWr15mSp2CpdkjrHBtJOwxfnGcW8ZWivUsNeMVJpccj6hD3nhzqXTMsEAlzvv+c89 DvEg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=EtbmAdUx; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-82461-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-82461-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id fb33-20020a056a002da100b006e4e237759dsi4534451pfb.376.2024.02.26.16.21.41 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 16:21:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-82461-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=EtbmAdUx; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-82461-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-82461-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 997E7B22B11 for <ouuuleilei@gmail.com>; Tue, 27 Feb 2024 00:21:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EA4DE17FF; Tue, 27 Feb 2024 00:21:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="EtbmAdUx" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 180FF161 for <linux-kernel@vger.kernel.org>; Tue, 27 Feb 2024 00:21:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708993270; cv=none; b=fGKwC+Ntg6zZjxOLj6r/ksShrtCi21s2OY76iEeGvwYVjcSlowJsHm116msL1fof+C8UBw0pfmENUVFQliRVpw2OzPkis9jMuwTVjlL4z84kexlN6BV1WP2w6kMqDcJSozt8/F8V0jcEkc51vk0xZFR0cE88ujU1HdX0FJLkCs8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708993270; c=relaxed/simple; bh=fYTwBpg7uMTawTUnQ2BSWuwAUKm59qg1pIXrtXgXbFU=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=m2F5c5POsMbJ/bpDcZN4ftRBLSpZdgX2QupeViq0rdUf9D7RmcjJ9CczMoBsQlUYDdDPhPbP0TfpT0kh/JwGnwv9nD/EXTu7FxW0as1AxQNL77K3Q3KR1aoOUAlb7495nGwGQpbKqq+L3O1acEaU9EdNd8qDJEg2TtdGqlYtCIU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=EtbmAdUx; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1708993266; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=deu2WpFSMCIwa7mbcBS0LlHiNgXZ/4WozKcv0iuRKBQ=; b=EtbmAdUx3TLx1uxDIteZl3MX4pjw150lSMFNoxCXZK1a9vZ8bBTG2fFDu9F4/Mfj4q6zcX WnuolmZ6gQMGgos5HRGYmgFJ4InES++k36k3DM5J1fuAQ0GdRn7HE6eLNH/KRxtlECAGAQ xt/bEpAQLU2W1L9a1pFttnbII1k7DCM= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-544-GFThb6AFOvKQon_xgJRCJA-1; Mon, 26 Feb 2024 19:21:05 -0500 X-MC-Unique: GFThb6AFOvKQon_xgJRCJA-1 Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-33d51bb9353so2024293f8f.2 for <linux-kernel@vger.kernel.org>; Mon, 26 Feb 2024 16:21:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708993263; x=1709598063; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=deu2WpFSMCIwa7mbcBS0LlHiNgXZ/4WozKcv0iuRKBQ=; b=JGoyjjr3BgVAg3AgEv/fSAKPVNW1Iu7pWaRemexl8kjUPQMw7UgmFQPXn3H5TZFmjW H4jc7s2AhpKHsLGzTkgK0DuOkZOG7v3c3XYEKQoAhgSegLnSl/jGzsw8NWhCLPSR0cCd Lo3zyHC84JrvDthV87Hc42NWxAofljbssE4miCyeBXRR9+bGR7EvjpfL2xSAzi1vgJTu D06vjZk0LHijyogw7p4uMH0YGCG0bXqQDFxgz1qPMHjeYEJ9MaNVIld2NMREFG3dwgCI 0LIOFXgu5EOKVzMVlWOvyt0bxqL43O451laND3sr3d/ZES09CU2YusOheM6tik7ZOKVO 3zdA== X-Gm-Message-State: AOJu0YyVkm/Ldt0enAlnKz8bKqq7WfXKM/sxXvqLxr3RRFnDUftBizFE en0jaM9hS2BCZwkdGipdsrQlHSIK/K3fI3I1yUUDUqo2sKfdRLjzYVCkmNu5VK6fJ4oYZzpTvdr W1AwdZdM1O3l/sZHaZm8jhDJlrqwYD1ls5rfKpqVFHjySzh/uYrROKbQUu16F7UdJx7odM1sWvA SdwxXyhF5i7Vybh0fexAyR+ETHaDXKIOCHvjZ7du/EEAXH X-Received: by 2002:a5d:588b:0:b0:33d:d96b:2615 with SMTP id n11-20020a5d588b000000b0033dd96b2615mr3090211wrf.47.1708993263477; Mon, 26 Feb 2024 16:21:03 -0800 (PST) X-Received: by 2002:a5d:588b:0:b0:33d:d96b:2615 with SMTP id n11-20020a5d588b000000b0033dd96b2615mr3090190wrf.47.1708993263000; Mon, 26 Feb 2024 16:21:03 -0800 (PST) Received: from localhost (205.pool92-176-231.dynamic.orange.es. [92.176.231.205]) by smtp.gmail.com with ESMTPSA id f1-20020adfe901000000b0033d8b1ace25sm9720705wrm.2.2024.02.26.16.21.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 16:21:02 -0800 (PST) From: Javier Martinez Canillas <javierm@redhat.com> To: linux-kernel@vger.kernel.org Cc: Nishanth Menon <nm@ti.com>, Javier Martinez Canillas <javierm@redhat.com>, Breno Leitao <leitao@debian.org>, Kalle Valo <kvalo@kernel.org>, Li Zetao <lizetao1@huawei.com>, linux-wireless@vger.kernel.org Subject: [PATCH] wlcore: sdio: warn only once for wl12xx_sdio_raw_{read,write}() failures Date: Tue, 27 Feb 2024 01:20:46 +0100 Message-ID: <20240227002059.379267-1-javierm@redhat.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792009359634705016 X-GMAIL-MSGID: 1792009359634705016 |
Series |
wlcore: sdio: warn only once for wl12xx_sdio_raw_{read,write}() failures
|
|
Commit Message
Javier Martinez Canillas
Feb. 27, 2024, 12:20 a.m. UTC
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(-)
Comments
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>
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.
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!
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; }