From patchwork Tue Feb 27 00:20:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Martinez Canillas X-Patchwork-Id: 206980 Return-Path: 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 (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 ; 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 ; 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 ; 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 To: linux-kernel@vger.kernel.org Cc: Nishanth Menon , Javier Martinez Canillas , Breno Leitao , Kalle Valo , Li Zetao , 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: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792009359634705016 X-GMAIL-MSGID: 1792009359634705016 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 Reviewed-by: Breno Leitao --- 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; }