From 053d180aded415d1051e512ad36908159282bfca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20Walstr=C3=B6m?= Date: Tue, 20 Jan 2026 20:27:40 +0100 Subject: [PATCH] wifi: rpi: Silence some bogus error message related to the firmaware The firmware seems to keep states when have been configured as an AP then change to be a station. --- ...ppress-log-spam-for-regulatory-restr.patch | 43 ++++++++++++ ...duce-log-noise-during-AP-to-station-.patch | 68 +++++++++++++++++++ 2 files changed, 111 insertions(+) create mode 100644 patches/linux/6.18.6/0031-wifi-brcmfmac-suppress-log-spam-for-regulatory-restr.patch create mode 100644 patches/linux/6.18.6/0032-wifi-brcmfmac-reduce-log-noise-during-AP-to-station-.patch diff --git a/patches/linux/6.18.6/0031-wifi-brcmfmac-suppress-log-spam-for-regulatory-restr.patch b/patches/linux/6.18.6/0031-wifi-brcmfmac-suppress-log-spam-for-regulatory-restr.patch new file mode 100644 index 00000000..2cb24633 --- /dev/null +++ b/patches/linux/6.18.6/0031-wifi-brcmfmac-suppress-log-spam-for-regulatory-restr.patch @@ -0,0 +1,43 @@ +From f4d3d21bbb0bf21d7ad12cbb419e6a4c464ea619 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Mattias=20Walstr=C3=B6m?= +Date: Tue, 20 Jan 2026 20:12:10 +0100 +Subject: [PATCH 31/32] wifi: brcmfmac: suppress log spam for + regulatory-restricted channels +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +Organization: Wires + +When scanning, the driver attempts to set each channel and logs an +error if the firmware rejects it. For regulatory-restricted channels, +the firmware returns -52 (EBADE), which is expected behavior. + +Suppress the error message for -52 errors to avoid spamming the kernel +log during normal scan operations. + +Signed-off-by: Mattias Walström +--- + .../net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +index 1d937e41b95f..f49e11160d02 100644 +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +@@ -8280,7 +8280,12 @@ brcmf_set_channel(struct brcmf_cfg80211_info *cfg, struct brcmf_if *ifp, + if (chspec != INVCHANSPEC) { + err = brcmf_fil_iovar_int_set(ifp, "chanspec", chspec); + if (err) { +- brcmf_err("set chanspec 0x%04x fail, reason %d\n", chspec, err); ++ /* -52 (EBADE) is expected for regulatory-restricted ++ * channels, don't spam the log for these. ++ */ ++ if (err != -EBADE) ++ brcmf_err("set chanspec 0x%04x fail, reason %d\n", ++ chspec, err); + err = -EINVAL; + } + } else { +-- +2.43.0 + diff --git a/patches/linux/6.18.6/0032-wifi-brcmfmac-reduce-log-noise-during-AP-to-station-.patch b/patches/linux/6.18.6/0032-wifi-brcmfmac-reduce-log-noise-during-AP-to-station-.patch new file mode 100644 index 00000000..295041af --- /dev/null +++ b/patches/linux/6.18.6/0032-wifi-brcmfmac-reduce-log-noise-during-AP-to-station-.patch @@ -0,0 +1,68 @@ +From 3592365d811531eaafd1973ba4954b8131c47bf8 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Mattias=20Walstr=C3=B6m?= +Date: Tue, 20 Jan 2026 20:18:45 +0100 +Subject: [PATCH 32/32] wifi: brcmfmac: reduce log noise during AP to station + transition +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +Organization: Wires + +When transitioning from AP mode to station mode (e.g., hostapd stopping +and wpa_supplicant starting), several non-fatal errors can occur: + +1. SET SSID error (-512) in stop_ap: This happens when hostapd is killed + before the firmware operation completes. -512 is ERESTARTSYS which is + expected in this scenario. + +2. MPC (Minimum Power Consumption) setting failures: These can occur + during mode transitions when the firmware is in an intermediate state. + MPC is a power optimization and failures are not critical. + +Suppress the ERESTARTSYS error in stop_ap and downgrade the MPC error +to debug level to reduce log spam during normal operation. + +Signed-off-by: Mattias Walström +--- + .../wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 13 +++++++++---- + 1 file changed, 9 insertions(+), 4 deletions(-) + +diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +index f49e11160d02..101cbb4e87e1 100644 +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +@@ -1130,13 +1130,15 @@ static void brcmf_scan_config_mpc(struct brcmf_if *ifp, int mpc) + + void brcmf_set_mpc(struct brcmf_if *ifp, int mpc) + { +- struct brcmf_pub *drvr = ifp->drvr; + s32 err = 0; + + if (check_vif_up(ifp->vif)) { + err = brcmf_fil_iovar_int_set(ifp, "mpc", mpc); + if (err) { +- bphy_err(drvr, "fail to set mpc\n"); ++ /* MPC setting can fail during mode transitions, ++ * this is not critical. ++ */ ++ brcmf_dbg(INFO, "fail to set mpc to %d: %d\n", mpc, err); + return; + } + brcmf_dbg(INFO, "MPC : %d\n", mpc); +@@ -5558,8 +5560,11 @@ static int brcmf_cfg80211_stop_ap(struct wiphy *wiphy, struct net_device *ndev, + memset(&join_params, 0, sizeof(join_params)); + err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_SSID, + &join_params, sizeof(join_params)); +- if (err < 0) +- bphy_err(drvr, "SET SSID error (%d)\n", err); ++ if (err < 0) { ++ /* -ERESTARTSYS is expected if hostapd was killed */ ++ if (err != -ERESTARTSYS) ++ bphy_err(drvr, "SET SSID error (%d)\n", err); ++ } + err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_DOWN, 1); + if (err < 0) + bphy_err(drvr, "BRCMF_C_DOWN error %d\n", err); +-- +2.43.0 +