brcmfmac: Silence error messages about unsupported firmware features
authorDmitry Osipenko <digetx@gmail.com>
Tue, 11 May 2021 21:15:49 +0000 (00:15 +0300)
committerKalle Valo <kvalo@codeaurora.org>
Wed, 23 Jun 2021 17:44:25 +0000 (20:44 +0300)
KMSG is flooded with error messages about unsupported firmware
features of BCM4329 chip. The GET_ASSOCLIST error became especially
noisy with a newer NetworkManager version of Ubuntu 21.04. Turn the
noisy error messages into info messages and print them out only once.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210511211549.30571-2-digetx@gmail.com
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.h

index 65fb038..cedba56 100644 (file)
@@ -2895,8 +2895,13 @@ brcmf_cfg80211_dump_station(struct wiphy *wiphy, struct net_device *ndev,
                                             &cfg->assoclist,
                                             sizeof(cfg->assoclist));
                if (err) {
-                       bphy_err(drvr, "BRCMF_C_GET_ASSOCLIST unsupported, err=%d\n",
-                                err);
+                       /* GET_ASSOCLIST unsupported by firmware of older chips */
+                       if (err == -EBADE)
+                               bphy_info_once(drvr, "BRCMF_C_GET_ASSOCLIST unsupported\n");
+                       else
+                               bphy_err(drvr, "BRCMF_C_GET_ASSOCLIST failed, err=%d\n",
+                                        err);
+
                        cfg->assoclist.count = 0;
                        return -EOPNOTSUPP;
                }
@@ -6851,7 +6856,12 @@ static int brcmf_setup_wiphybands(struct brcmf_cfg80211_info *cfg)
 
        err = brcmf_fil_iovar_int_get(ifp, "rxchain", &rxchain);
        if (err) {
-               bphy_err(drvr, "rxchain error (%d)\n", err);
+               /* rxchain unsupported by firmware of older chips */
+               if (err == -EBADE)
+                       bphy_info_once(drvr, "rxchain unsupported\n");
+               else
+                       bphy_err(drvr, "rxchain error (%d)\n", err);
+
                nchain = 1;
        } else {
                for (nchain = 0; rxchain; nchain++)
index cee1682..db5f853 100644 (file)
@@ -188,9 +188,14 @@ static void _brcmf_set_multicast_list(struct work_struct *work)
        /*Finally, pick up the PROMISC flag */
        cmd_value = (ndev->flags & IFF_PROMISC) ? true : false;
        err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_PROMISC, cmd_value);
-       if (err < 0)
-               bphy_err(drvr, "Setting BRCMF_C_SET_PROMISC failed, %d\n",
-                        err);
+       if (err < 0) {
+               /* PROMISC unsupported by firmware of older chips */
+               if (err == -EBADE)
+                       bphy_info_once(drvr, "BRCMF_C_SET_PROMISC unsupported\n");
+               else
+                       bphy_err(drvr, "Setting BRCMF_C_SET_PROMISC failed, err=%d\n",
+                                err);
+       }
        brcmf_configure_arp_nd_offload(ifp, !cmd_value);
 }
 
index 44ba6f3..9bb5f70 100644 (file)
@@ -60,6 +60,10 @@ void __brcmf_err(struct brcmf_bus *bus, const char *func, const char *fmt, ...);
                                  ##__VA_ARGS__);                       \
        } while (0)
 
+#define bphy_info_once(drvr, fmt, ...)                                 \
+       wiphy_info_once((drvr)->wiphy, "%s: " fmt, __func__,            \
+                       ##__VA_ARGS__)
+
 #if defined(DEBUG) || defined(CONFIG_BRCM_TRACING)
 
 /* For debug/tracing purposes treat info messages as errors */