Skip to contentSkip to conversation

brcmfmac: Remove a bunch of false positive error logs

PATCH Superseded Hans de Goede 2 participants 6 messages Feb 27, 2017 – Mar 7, 2017 Broadcom BRCM80211 IEEE802.11 wireless drivers

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

cover brcmfmac: Remove a bunch of false positive error logs

Hi All,

Here is a small series to stop brcmfmac from spamming dmesg with errors which are not really errors at all.

Note the 4th patch actually contains a small behavior change rather then just changing logging, so it needs a bit of extra review attention.

Regards,

Hans

#1 lore raw

PATCH 1/4 brcmfmac: Do not print the firmware version as an error

Using pr_err for things which are not errors is a bad idea. E.g. it will cause the plymouth bootsplash screen to drop back to the text console so that the user can see the error, which is not what we normally want to happen.

Instead add a new brcmf_info macro and use that.

---
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c | 2 +-
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.h  | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)
drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c +1 -1
index 3e15d64..6d565f1 100644
@@ -161,7 +161,7 @@ int brcmf_c_preinit_dcmds(struct brcmf_if *ifp)
 	strsep(&ptr, "\n");
 
 	/* Print fw version info */
-	brcmf_err("Firmware version = %s\n", buf);
+	brcmf_info("Firmware version = %s\n", buf);
 
 	/* locate firmware version number for ethtool */
 	ptr = strrchr(buf, ' ') + 1;
drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.h +3 -0
index 6687812..d0d8180 100644
@@ -59,11 +59,14 @@
 			pr_err("%s: " fmt, __func__, ##__VA_ARGS__);	\
 	} while (0)
 #endif
+#define brcmf_info(fmt, ...)	pr_info("%s: " fmt, __func__, ##__VA_ARGS__)
 #else
 __printf(2, 3)
 void __brcmf_err(const char *func, const char *fmt, ...);
 #define brcmf_err(fmt, ...) \
 	__brcmf_err(__func__, fmt, ##__VA_ARGS__)
+/* For tracing purposes treat info messages as errors */
+#define brcmf_info brcm_err
 #endif
 
 #if defined(DEBUG) || defined(CONFIG_BRCM_TRACING)
Signature · 1 line
2.9.3
#2 lore raw

PATCH 2/4 brcmfmac: p2p and normal ap access are not always possible at the same time

In reply to Hans de Goede

The firmware responding with -EBUSY when trying to add an extra virtual-if is a normal thing, do not print an error for this.

---
 .../net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c    | 14 ++++++++++----
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c     |  5 ++++-
 2 files changed, 14 insertions(+), 5 deletions(-)
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +10 -4
index 7ffc4ab..c54e8b4 100644
@@ -688,11 +688,17 @@ static struct wireless_dev *brcmf_cfg80211_add_iface(struct wiphy *wiphy,
 		return ERR_PTR(-EINVAL);
 	}
 
-	if (IS_ERR(wdev))
-		brcmf_err("add iface %s type %d failed: err=%d\n",
-			  name, type, (int)PTR_ERR(wdev));
-	else
+	if (IS_ERR(wdev)) {
+		err = PTR_ERR(wdev);
+		if (err != -EBUSY)
+			brcmf_err("add iface %s type %d failed: err=%d\n",
+				  name, type, err);
+		else
+			brcmf_dbg(INFO, "add iface %s type %d failed: err=%d\n",
+				  name, type, err);
+	} else {
 		brcmf_cfg80211_update_proto_addr_mode(wdev);
+	}
 
 	return wdev;
 }
drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c +4 -1
index de19c7c..b5df0a0 100644
@@ -2090,7 +2090,10 @@ static struct wireless_dev *brcmf_p2p_create_p2pdev(struct brcmf_p2p_info *p2p,
 	/* Initialize P2P Discovery in the firmware */
 	err = brcmf_fil_iovar_int_set(pri_ifp, "p2p_disc", 1);
 	if (err < 0) {
-		brcmf_err("set p2p_disc error\n");
+		if (err != -EBUSY)
+			brcmf_err("set p2p_disc error\n");
+		else
+			brcmf_dbg(INFO, "set p2p_disc error\n");
 		brcmf_fweh_p2pdev_setup(pri_ifp, false);
 		brcmf_cfg80211_arm_vif_event(p2p->cfg, NULL);
 		goto fail;
Signature · 1 line
2.9.3
#3 lore raw

PATCH 3/4 brcmfmac: Do not complain about country code "00"

In reply to Hans de Goede

The country code gets set to "00" by default at boot, ignore this rather then logging an error about it.

---
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +4 -0
index c54e8b4..c0b7f69 100644
@@ -6705,6 +6705,10 @@ static void brcmf_cfg80211_reg_notifier(struct wiphy *wiphy,
 	s32 err;
 	int i;
 
+	/* The country code gets set to "00" by default at boot, ignore */
+	if (req->alpha2[0] == '0' && req->alpha2[1] == '0')
+		return;
+
 	/* ignore non-ISO3166 country codes */
 	for (i = 0; i < sizeof(req->alpha2); i++)
 		if (req->alpha2[i] < 'A' || req->alpha2[i] > 'Z') {
Signature · 1 line
2.9.3
#4 lore raw

PATCH 4/4 brcmfmac: Handle status == BRCMF_E_STATUS_ABORT in cfg80211_escan_handler

In reply to Hans de Goede

If a scan gets aborted BRCMF_SCAN_STATUS_BUSY gets cleared in cfg->scan_status and when we receive an abort event from the firmware the BRCMF_SCAN_STATUS_BUSY check in the cfg80211_escan_handler will trigger resulting in multiple errors getting logged.

Check for a status of BRCMF_E_STATUS_ABORT and in this case simply cleanly exit the cfg80211_escan_handler. This also avoids a BRCMF_E_STATUS_ABORT event arriving after a new scan has been started causing the new scan to complete prematurely without any data.

---
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +3 -0
index c0b7f69..4c740b74 100644
@@ -3105,6 +3105,9 @@ brcmf_cfg80211_escan_handler(struct brcmf_if *ifp,
 
 	status = e->status;
 
+	if (status == BRCMF_E_STATUS_ABORT)
+		goto exit;
+
 	if (!test_bit(BRCMF_SCAN_STATUS_BUSY, &cfg->scan_status)) {
 		brcmf_err("scan not ready, bsscfgidx=%d\n", ifp->bsscfgidx);
 		return -EPERM;
Signature · 1 line
2.9.3
#5 lore raw
In reply to Hans de Goede
Quoted 5 lines · Hans de Goede

Here is a small series to stop brcmfmac from spamming dmesg with errors which are not really errors at all.

Note the 4th patch actually contains a small behavior change rather then just changing logging, so it needs a bit of extra review attention.

Arend, did you miss these? I don't see an ack from you.

Signature · 1 line
Kalle Valo