From patchwork Thu Feb 16 07:26:36 2017 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: 9576605 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.web.codeaurora.org (Postfix) with ESMTP id 0BF2460244 for ; Thu, 16 Feb 2017 07:27:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EEA572858D for ; Thu, 16 Feb 2017 07:27:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E2EE328593; Thu, 16 Feb 2017 07:27:05 +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=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM 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 7DF712858B for ; Thu, 16 Feb 2017 07:27:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753785AbdBPH1B (ORCPT ); Thu, 16 Feb 2017 02:27:01 -0500 Received: from mail-lf0-f67.google.com ([209.85.215.67]:32890 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752186AbdBPH06 (ORCPT ); Thu, 16 Feb 2017 02:26:58 -0500 Received: by mail-lf0-f67.google.com with SMTP id x1so714217lff.0; Wed, 15 Feb 2017 23:26:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=UcVJJj440+Eidq2XoZZVAu7JyOKBktS7votumAKIzPI=; b=bUlXy3lnddkLs0DB/r2j87WxqqdZ7wo1VC14D30MoaEEX17Enp6nx+4sz64T0wFWY5 At2G0XqddbsnDTam9mCvzfBmauqceaJlFj9VEIiUA6yJF/ZiBmOTmmcJewG3JCIg6Uat B7HaU29vvv64zicI0bOdApqpVt26O/r4oMgcktWMFltza4HvK5NRqDll/AxPsyD9rYbc IUScbCRRSHmVjSQV/JhLuB516SFhscK4eQE1UTRh0Xqde9V6uOalG8VfXW/KPNGk/g7w dLgnDwppt6GSDcGmfw0n9jkfKvybO61WI8Upf1LPr89dWpl0hS8+7gVAg7ej6zW1jdrx o2vA== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=UcVJJj440+Eidq2XoZZVAu7JyOKBktS7votumAKIzPI=; b=uUubLaTIf9YZectvRXPtX80n5k9dzR3j65KVhutSpaa+n6+i4+kCi3IRoTpNd+9L2j KeqV7AyT0Fbd7XmgQ3wuWSltzmXO185tQ6moeF+od4JjcZdruDlx8EgSWpa489xql1LV 5c4Bor6szX1l5BGY4BNHcbyzNfMbcGHo8ESBIuYvzzcRRx6YlccX3R85OrcsetOSuWO+ 08wNO0dmPg3MkGQXjCPlPm5m+qj4KOUS09HeSI77kw4p6n+rJon6DRXbsDEBDe8p9wq5 44wOLRWliqmMRbYEVc3vO4AmJWbzMbkOORHXQ/nESvLyjP6GqE0AAJp+zbGj93LpTwDN 4Wpw== X-Gm-Message-State: AMke39lgfDND9gfQt28GmCSRjAr9cq3/2zjd1nJc2z8ciHGZvyg+YAblbXCzOBdMvyS3SQ== X-Received: by 10.25.153.2 with SMTP id b2mr272621lfe.85.1487230016280; Wed, 15 Feb 2017 23:26:56 -0800 (PST) Received: from linux-samsung.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by smtp.gmail.com with ESMTPSA id 187sm1506277ljf.12.2017.02.15.23.26.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Feb 2017 23:26:55 -0800 (PST) From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= To: Ming Lei , "Luis R . Rodriguez" , Greg KH , Linux Kernel Mailing List Cc: Kalle Valo , Arend van Spriel , linux-wireless@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com, =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Subject: [PATCH V2 2/2] brcmfmac: don't warn user about NVRAM if fallback to platform one succeeds Date: Thu, 16 Feb 2017 08:26:36 +0100 Message-Id: <20170216072636.7128-2-zajec5@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170216072636.7128-1-zajec5@gmail.com> References: <20170215222948.21030-1-zajec5@gmail.com> <20170216072636.7128-1-zajec5@gmail.com> 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 Failing to load NVRAM file isn't critical if we manage to get platform one in the fallback path. It means warnings like: [ 10.801506] brcmfmac 0000:01:00.0: Direct firmware load for brcm/brcmfmac43602-pcie.txt failed with error -2 are unnecessary & disturbing for people with platform NVRAM. This is very common case for Broadcom home routers. So instead of printing warning immediately with the firmware subsystem let's first try our fallback code. If that fails as well, then it's a right moment to print an error. This should reduce amount of false reports from users seeing this warning while having wireless working perfectly fine. Signed-off-by: Rafał Miłecki --- V2: Update commit message as it wasn't clear enough (thanks Andy) & add extra messages to the firmware.c. Kalle, Arend: this patch is strictly related to the bigger 1/2. Could you ack this change as I expect this patchset to be picked by Ming, Luis or Greg? --- .../net/wireless/broadcom/brcm80211/brcmfmac/firmware.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c index c7c1e9906500..510a76d99eee 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c @@ -462,8 +462,14 @@ static void brcmf_fw_request_nvram_done(const struct firmware *fw, void *ctx) raw_nvram = false; } else { data = bcm47xx_nvram_get_contents(&data_len); - if (!data && !(fwctx->flags & BRCMF_FW_REQ_NV_OPTIONAL)) - goto fail; + if (!data) { + brcmf_dbg(TRACE, "Failed to get platform NVRAM\n"); + if (!(fwctx->flags & BRCMF_FW_REQ_NV_OPTIONAL)) { + brcmf_err("Loading NVRAM from %s and using platform one both failed\n", + fwctx->nvram_name); + goto fail; + } + } raw_nvram = true; } @@ -504,9 +510,9 @@ static void brcmf_fw_request_code_done(const struct firmware *fw, void *ctx) return; } fwctx->code = fw; - ret = request_firmware_nowait(THIS_MODULE, true, fwctx->nvram_name, - fwctx->dev, GFP_KERNEL, fwctx, - brcmf_fw_request_nvram_done); + ret = request_firmware_async(THIS_MODULE, FW_OPT_NO_WARN, + fwctx->nvram_name, fwctx->dev, GFP_KERNEL, + fwctx, brcmf_fw_request_nvram_done); if (!ret) return;