From patchwork Fri Oct 26 11:22:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 10657255 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0F17A14BD for ; Fri, 26 Oct 2018 11:22:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F00982BF9B for ; Fri, 26 Oct 2018 11:22:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E3EA32BFDA; Fri, 26 Oct 2018 11:22:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 89E502BF9B for ; Fri, 26 Oct 2018 11:22:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727428AbeJZT73 (ORCPT ); Fri, 26 Oct 2018 15:59:29 -0400 Received: from mail-lf1-f68.google.com ([209.85.167.68]:45870 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727313AbeJZT72 (ORCPT ); Fri, 26 Oct 2018 15:59:28 -0400 Received: by mail-lf1-f68.google.com with SMTP id c24-v6so619218lfi.12 for ; Fri, 26 Oct 2018 04:22:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=WFXMQhrzlhNhjA2qSVeN3rBaOFul3j6zBAS8zlLOf7o=; b=TJl1kY1xtriO71/KmCrfYujL6X/eiIsmg9gevA5dNshE87Mwwstn8v8PX4MlqunfID ku4uMdyvbp33y7iJi7iCq1bAFV7Ogql3/h6gXGIFpdVfH7m2MHq62AQI832dMj2oia5r w/eyR2eNwYRXLa9GlPFlEJp6TK9RdgnVAbw9ZLdUxPLgRut4NJ7nzEjLes1qlipmmDJT adEL03DNHqAA/4+KIhSV2EkwHFACJlnYAZif6zcood/KrUBY6U+QZvUVqo/DAGPMDwXb J0nHemriXBPoA57jLMFckcQVPFFN9ntYLKwPeKC3y23Jo0hP2IKsPEF+leE7BPLRpGzm bqJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=WFXMQhrzlhNhjA2qSVeN3rBaOFul3j6zBAS8zlLOf7o=; b=oQzNkPFF6DlPDVbVnSo5gEK125scZN1pgSVJeAvN0JhBZv3BY6/NuTXQ6W12fsVijp sW2WsbnNQzPUIQeBtTf7cugj5W4jK6cNDgOhf1aheLKTCTg70o0UE+vm963Yb5TyX1pZ YkzwAtsCNmD3x/+8falVYvcj58p6OvN9k/FB2LpfHkfqTsZGyXKn6eSC7hFRVKkM0x0b Y8y4vfwGpcXTVD5bAtYyML0FsGnRYc4aXZXKWieSk0r2IXfpwxWX1NOmoffKmFLx7+3n J6wPlARoeqL/akd61P66Lx/1Q0aTXe6yWowtWYyB9CBE64cevVS1754Uvkq2qm0q+WXw ybOw== X-Gm-Message-State: AGRZ1gLa4EJzwpmxHHWE7gqubYxjuqjphvTVNDEkIe6JKsFwQ9uSttGl gyQIpW+S8vYUMMMrD7+T1Zk= X-Google-Smtp-Source: AJdET5eXDiucr++TY5Zi45Dh/o7lnlsg/AtnX21xfeTlcPpwm4RfgyVRxLQMr8/l6tpDqLHYfdhTvA== X-Received: by 2002:ac2:4299:: with SMTP id m25-v6mr1912158lfh.115.1540552964218; Fri, 26 Oct 2018 04:22:44 -0700 (PDT) Received: from linux-veee.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by smtp.gmail.com with ESMTPSA id b123-v6sm1718207lfe.54.2018.10.26.04.22.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 26 Oct 2018 04:22:42 -0700 (PDT) From: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= To: Kalle Valo Cc: Arend van Spriel , Franky Lin , Hante Meuleman , Chi-Hsien Lin , Wright Feng , Pieter-Paul Giesberts , Chung-Hsien Hsu , linux-wireless@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com, brcm80211-dev-list@cypress.com, =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= Subject: [PATCH] brcmutil: print invalid chanspec when WARN-ing Date: Fri, 26 Oct 2018 13:22:32 +0200 Message-Id: <20181026112232.22699-1-zajec5@gmail.com> X-Mailer: git-send-email 2.13.7 MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Rafał Miłecki On one of my devices I got WARNINGs when brcmfmac tried to decode chanspec. I couldn't tell if it was some unsupported format or just a malformed value passed by a firmware. Print chanspec value so it's possible to debug a possible problem. Signed-off-by: Rafał Miłecki --- There is no rush with this one, it can wait for post 4.20 merge window. --- drivers/net/wireless/broadcom/brcm80211/brcmutil/d11.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmutil/d11.c b/drivers/net/wireless/broadcom/brcm80211/brcmutil/d11.c index eb5db94f5745..8ac34821f1c1 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmutil/d11.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmutil/d11.c @@ -128,7 +128,7 @@ static void brcmu_d11n_decchspec(struct brcmu_chan *ch) } break; default: - WARN_ON_ONCE(1); + WARN_ONCE(1, "Invalid chanspec 0x%04x\n", ch->chspec); break; } @@ -140,7 +140,7 @@ static void brcmu_d11n_decchspec(struct brcmu_chan *ch) ch->band = BRCMU_CHAN_BAND_2G; break; default: - WARN_ON_ONCE(1); + WARN_ONCE(1, "Invalid chanspec 0x%04x\n", ch->chspec); break; } } @@ -167,7 +167,7 @@ static void brcmu_d11ac_decchspec(struct brcmu_chan *ch) ch->sb = BRCMU_CHAN_SB_U; ch->control_ch_num += CH_10MHZ_APART; } else { - WARN_ON_ONCE(1); + WARN_ONCE(1, "Invalid chanspec 0x%04x\n", ch->chspec); } break; case BRCMU_CHSPEC_D11AC_BW_80: @@ -188,7 +188,7 @@ static void brcmu_d11ac_decchspec(struct brcmu_chan *ch) ch->control_ch_num += CH_30MHZ_APART; break; default: - WARN_ON_ONCE(1); + WARN_ONCE(1, "Invalid chanspec 0x%04x\n", ch->chspec); break; } break; @@ -222,13 +222,13 @@ static void brcmu_d11ac_decchspec(struct brcmu_chan *ch) ch->control_ch_num += CH_70MHZ_APART; break; default: - WARN_ON_ONCE(1); + WARN_ONCE(1, "Invalid chanspec 0x%04x\n", ch->chspec); break; } break; case BRCMU_CHSPEC_D11AC_BW_8080: default: - WARN_ON_ONCE(1); + WARN_ONCE(1, "Invalid chanspec 0x%04x\n", ch->chspec); break; } @@ -240,7 +240,7 @@ static void brcmu_d11ac_decchspec(struct brcmu_chan *ch) ch->band = BRCMU_CHAN_BAND_2G; break; default: - WARN_ON_ONCE(1); + WARN_ONCE(1, "Invalid chanspec 0x%04x\n", ch->chspec); break; } }