Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1585172

[PATCH V3 2/2] brcmfmac: don't warn user about NVRAM if fallback to platform one succeeds

From Rafał Miłecki <zajec5@gmail.com>
Newsgroups linux.kernel
Subject [PATCH V3 2/2] brcmfmac: don't warn user about NVRAM if fallback to platform one succeeds
Date 2017-02-21 10:50 +0100
Message-ID <tdff4-Kd-17@gated-at.bofh.it> (permalink)
References <tboFP-2Yn-3@gated-at.bofh.it> <tdff4-Kd-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Rafał Miłecki <rafal@milecki.pl>

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 <rafal@milecki.pl>
---
V2: Update commit message as it wasn't clear enough (thanks Andy) & add extra
    messages to the firmware.c.
V3: Set FW_OPT_UEVENT to don't change behavior

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 | 17 ++++++++++++-----
 1 file changed, 12 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..6dbcceff2529 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,10 @@ 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_UEVENT | FW_OPT_NO_WARN,
+				     fwctx->nvram_name, fwctx->dev, GFP_KERNEL,
+				     fwctx, brcmf_fw_request_nvram_done);
 
 	if (!ret)
 		return;
-- 
2.11.0

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 1/2] firmware: add more flexible request_firmware_async function Rafał Miłecki <zajec5@gmail.com> - 2017-02-15 23:40 +0100
  [PATCH 2/2] brcmfmac: don't warn user if loading firmware file with NVRAM fails Rafał Miłecki <zajec5@gmail.com> - 2017-02-15 23:40 +0100
    Re: [PATCH 2/2] brcmfmac: don't warn user if loading firmware file  with NVRAM fails Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-02-16 02:20 +0100
      Re: [PATCH 2/2] brcmfmac: don't warn user if loading firmware file  with NVRAM fails Rafał Miłecki <rafal@milecki.pl> - 2017-02-16 08:50 +0100
  [PATCH V2 2/2] brcmfmac: don't warn user about NVRAM if fallback to platform one succeeds Rafał Miłecki <zajec5@gmail.com> - 2017-02-16 08:30 +0100
    Re: [PATCH V2 2/2] brcmfmac: don't warn user about NVRAM if fallback  to platform one succeeds Arend Van Spriel <arend.vanspriel@broadcom.com> - 2017-02-16 09:40 +0100
      Re: [PATCH V2 2/2] brcmfmac: don't warn user about NVRAM if fallback  to platform one succeeds Arend Van Spriel <arend.vanspriel@broadcom.com> - 2017-02-16 10:20 +0100
        Re: [PATCH V2 2/2] brcmfmac: don't warn user about NVRAM if fallback  to platform one succeeds Rafał Miłecki <rafal@milecki.pl> - 2017-02-16 11:00 +0100
          Re: [PATCH V2 2/2] brcmfmac: don't warn user about NVRAM if fallback  to platform one succeeds Arend Van Spriel <arend.vanspriel@broadcom.com> - 2017-02-16 11:20 +0100
      Re: [PATCH V2 2/2] brcmfmac: don't warn user about NVRAM if fallback  to platform one succeeds Rafał Miłecki <rafal@milecki.pl> - 2017-02-16 11:30 +0100
  [PATCH V2 1/2] firmware: add more flexible request_firmware_async function Rafał Miłecki <zajec5@gmail.com> - 2017-02-16 08:30 +0100
    [PATCH V3 1/2] firmware: add more flexible request_firmware_async function Rafał Miłecki <zajec5@gmail.com> - 2017-02-21 10:50 +0100
      [PATCH V3 2/2] brcmfmac: don't warn user about NVRAM if fallback to platform one succeeds Rafał Miłecki <zajec5@gmail.com> - 2017-02-21 10:50 +0100
        Re: [PATCH V3 2/2] brcmfmac: don't warn user about NVRAM if fallback  to platform one succeeds Arend Van Spriel <arend.vanspriel@broadcom.com> - 2017-02-21 11:00 +0100
          Re: [PATCH V3 2/2] brcmfmac: don't warn user about NVRAM if fallback to platform one succeeds Kalle Valo <kvalo@codeaurora.org> - 2017-02-21 12:50 +0100
      Re: [PATCH V3 1/2] firmware: add more flexible  request_firmware_async function "Luis R. Rodriguez" <mcgrof@kernel.org> - 2017-02-21 19:10 +0100
      [PATCH V4 2/2] brcmfmac: don't warn user about NVRAM if fallback to platform one succeeds Rafał Miłecki <zajec5@gmail.com> - 2017-02-23 19:40 +0100
      [PATCH V4 1/2] firmware: add more flexible request_firmware_async function Rafał Miłecki <zajec5@gmail.com> - 2017-02-23 19:40 +0100
    Re: [PATCH V2 1/2] firmware: add more flexible  request_firmware_async function "Luis R. Rodriguez" <mcgrof@kernel.org> - 2017-02-21 19:10 +0100
  Re: [PATCH 1/2] firmware: add more flexible request_firmware_async  function "Luis R. Rodriguez" <mcgrof@kernel.org> - 2017-02-21 19:10 +0100

csiph-web