Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1626033rbb; Mon, 26 Feb 2024 16:21:14 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXN9c6KklLpVFL6nrjlds4jVioZGcK+DSoXbeHYj2/krL1Z/nbP54L99ftubj2mxnNxnVspawHXc0VrsUX2w+GX7wdaosaiKzSwnPmVvQ== X-Google-Smtp-Source: AGHT+IE1bduwvzuHrcymXdLdrNyfJU7BZy7yONfVkthWkrs1/8jslnAUOTel5eE78O73YTMbqU4Q X-Received: by 2002:a17:906:cec2:b0:a3e:c1c8:1e3a with SMTP id si2-20020a170906cec200b00a3ec1c81e3amr5612855ejb.72.1708993273938; Mon, 26 Feb 2024 16:21:13 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708993273; cv=pass; d=google.com; s=arc-20160816; b=PTrcF1lkdTEjuF7hvoriIuTB+BHkW+IPF0CnG9m+Imtx9KQEmDXkPAAgxLWKdoTRs9 80FV0CXX/rZeKEkaUMpzUeGmJ+jtG8aXfdn5n6CC+hhZJcrmTenah0NCG281tKO02j+b Ds8R009mG1Ev+Tv1clS9iFrGEejlihGvljW//gdMI0vUJqeSOK8qflbtap5ggrwHdhRd 46urNElmYqvmQHUCu5lQpzh6XkkwFmfLB6VaeVm9UP0gpr6MsVKoiZ4ue9zC3zGiIr7x mzdPQWVj0ZKbCJX0uvgWhTR//H1Nrgf6QxapuJZdTAU+QDbfdRUjzZ2QxAuxI9+fgnM6 k3Xg== 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=4DWyZaku/NX9PJU2BkAgGQPmrnzUp40iEwUpE86+EPA=; b=0gBCEcEYYlXDgQEfekpox7fdVxTZoTn74bFz3DTz3aCi57uHnpk9Ehk1qB4qd0OgDN bGJUSpJTfv9WntMYS1Th04ay2K4/z5dJU6CjYINvRW/nt1mrDw2EmsB+vhZWW3BT15iv PwQHICZNE/cYXZC3R2OjMEEyGRzmKON3nFhv6ukrpSaaz2sJKWF5fDLod5vVpJQ820HW P3lwp8V/rMs1mqi5Sozd+MMHN3EvvkmuWedSthXFwkDEHd0dpOsyq54zWBJ4okibWOTi 28rEbDPVKK/mhjMwJxpcfC030e+NFu6+xX424E9b/ALM05hAUh87yPLTN0UXce36ykxB kr2Q==; 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-wireless+bounces-4035-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-wireless+bounces-4035-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id jo3-20020a170906f6c300b00a413e285dadsi199953ejb.334.2024.02.26.16.21.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 16:21:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-4035-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; 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-wireless+bounces-4035-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-wireless+bounces-4035-linux.lists.archive=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 am.mirrors.kernel.org (Postfix) with ESMTPS id 983221F22BB3 for ; Tue, 27 Feb 2024 00:21:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D677E36D; Tue, 27 Feb 2024 00:21:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="EtbmAdUx" X-Original-To: linux-wireless@vger.kernel.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.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 23E0B36C for ; Tue, 27 Feb 2024 00:21:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708993269; cv=none; b=iWbMVDelyyQ6/nWg+oNN51TGHT1FgO3FQgmy45N/FmP0dqrJlsPyIeyJF01oUzYj4CnvHoQVjZJZKOG8avPMdq5ZPPO7R6GLGYtkPqkImJRmErD27QJ4mXD0FoMPwWMVtDlbxOKPIfH+Q7eOKudEmNo4g4mKWN4RYUaBd1DfIAs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708993269; c=relaxed/simple; bh=fYTwBpg7uMTawTUnQ2BSWuwAUKm59qg1pIXrtXgXbFU=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=FQ0Sgs/MwLuFpEf6kZv4bMvKrVgxJZ/xKw97ciqzGpflF0oSp0J9gi9+K41xMf6lL/pU1buupQ+0cRnZRwo/44nwFqP7xWkplZsv61ZUcFVQiqjO3KB3FzQvPFeAvKpSNv3v33mSAhEmjiuRWvGSZ0PNhi0oMOjPVcPUt5Q4PqY= 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.129.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-449-Zlk-oQ-3NHihdyEn-k_ejQ-1; Mon, 26 Feb 2024 19:21:05 -0500 X-MC-Unique: Zlk-oQ-3NHihdyEn-k_ejQ-1 Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-33dadb50731so1954215f8f.1 for ; Mon, 26 Feb 2024 16:21:04 -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=VJZMAjPBnDuTDSupuemQ1jHMP9eY88NrsG1oyIsuZVFpWHQYgAKielyFr6glx/wWuR PB8jQg6HmeqjBMekkpO9J93jn4kfPMc/i2dWgOXe0+0c1dX0RCu5hUsRFKaGecVrF7Nn 25J8Z9BHapczxcP+r7oplpxqxETa6Sx7tgZUvWycsvkwfoVPH51PECiw6AryLSUFBq1A r/SkcmH8U8f6/ToAAMBdZIGZ/1/C8savOiNBL8mVAEDZMzBXbDiwYBT/Yc6+KZXqNhvh NJYZm9OQ8K5eOsC+VQX7WjTB6HooE0zAB8O5pQQxxJwrOQpBoyCcRPr7srAWivQO8JOf r7bA== X-Forwarded-Encrypted: i=1; AJvYcCUkfG5//FOKMngAnoU4T3xkpVhbG09rIdgE/I0kaBtGudqNfF+c9CHABCDuO1z7macRimUkkI43lpOv2tHG/KKHn9nn+Yt77InWPcmOkBk= X-Gm-Message-State: AOJu0Yz1bWWtCOVpD503cj/lgpcD3dHyVB3UJrskCAoxSnF93eBQfYUX PswqGBQ/JTf1Y2tU3Wn3XLkvxVdjfYR/Br9Zg+FNLvh6QwvRARhN6aiF4KKbDVhC9pixWg/i0w4 60c6c4jJzOdWz2kL9843I35AAT4fD7I5qJx5DIOouzNj/zZMlpUvg3XXwR+eL+gNS X-Received: by 2002:a5d:588b:0:b0:33d:d96b:2615 with SMTP id n11-20020a5d588b000000b0033dd96b2615mr3090208wrf.47.1708993263418; 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-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 --- 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