From patchwork Fri Apr 15 05:43:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aaron Ma X-Patchwork-Id: 1617647 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=X9ZXpfLy; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4KflcM4H8qz9sCq for ; Fri, 15 Apr 2022 15:43:30 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1nfEjp-0000fy-27; Fri, 15 Apr 2022 05:43:21 +0000 Received: from smtp-relay-canonical-1.internal ([10.131.114.174] helo=smtp-relay-canonical-1.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1nfEjm-0000fT-Po for kernel-team@lists.ubuntu.com; Fri, 15 Apr 2022 05:43:18 +0000 Received: from localhost.localdomain (unknown [222.129.35.96]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-1.canonical.com (Postfix) with ESMTPSA id 404E23F773 for ; Fri, 15 Apr 2022 05:43:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1650001398; bh=SYpzHmstnZrwSPCX4mccQKG75pHV5ViOiTD7Thpike4=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=X9ZXpfLyWB3dsKpD/yFdICHokfgfw9x/iaWytjibADntf0sF2+jsZ16yft3HjXs+T DMIKibfQpU/KtICMKW6BYs7hPMRvDQlfxff+OglgNtCD6N/IyrNg8BW4bcLMsZQrHt X0wR4aCzfdjNwjZgE9QgSUkMWuCYEtPsi/nbSxdLYJW84Yqw3xSsg0O8E42ObKsgzg mLmpEriaEiGwgabhXe2JQZYBXiMCJCjQ7EF6SQtOfYKYOUGyqXkBl/7p8F/JfoXpxM Uj5QOrszicNdRhjlJGtCc0fOq33Rmx6RyOwpYttfuBNiu3OQZzsi8OhaieO91KscGt LEBrpizx/V9dw== From: Aaron Ma To: kernel-team@lists.ubuntu.com Subject: [PATCH 1/1][OEM-5.14] iwlwifi: mvm: use debug print instead of WARN_ON() Date: Fri, 15 Apr 2022 13:43:06 +0800 Message-Id: <20220415054306.15123-2-aaron.ma@canonical.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220415054306.15123-1-aaron.ma@canonical.com> References: <20220415054306.15123-1-aaron.ma@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Miri Korenblit BugLink: https://bugs.launchpad.net/bugs/1969181 In MCC_UPDATE_CMD we get from the FW the number of entries in the channel info array. We used to WARN_ON if this parameter is greater than we expected. Since this is not really a driver bug, and since it might happen in some valid cases too, we shouldn't use a warning here. Fix this by replacing the WARN_ON with a debug print. Signed-off-by: Miri Korenblit Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20220130115024.3cb9828df280.I14abe7c71b45bbae3d3cd503e6e13fa2cd372ed4@changeid Signed-off-by: Luca Coelho (cherry picked from commit 853450a618022ea9e488a3f55f8826d1bb5a66bb) Signed-off-by: Aaron Ma --- drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c b/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c index ac337fce8f34..6c9e2e163a7f 100644 --- a/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c +++ b/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c @@ -1295,8 +1295,12 @@ iwl_parse_nvm_mcc_info(struct device *dev, const struct iwl_cfg *cfg, nvm_chan = iwl_nvm_channels; } - if (WARN_ON(num_of_ch > max_num_ch)) + if (num_of_ch > max_num_ch) { + IWL_DEBUG_DEV(dev, IWL_DL_LAR, + "Num of channels (%d) is greater than expected. Truncating to %d\n", + num_of_ch, max_num_ch); num_of_ch = max_num_ch; + } if (WARN_ON_ONCE(num_of_ch > NL80211_MAX_SUPP_REG_RULES)) return ERR_PTR(-EINVAL);