brcmfmac: Stability change series
v2 cover brcmfmac: Stability change series
This series fixes stability and connection related failures.
Changes in v2:
- Correct all typos in commit message
Prasanna Kerekoppa (1):
brcmfmac: To fix Bss Info flag definition Bug
Raveendran Somu (1):
brcmfmac: To fix kernel crash on out of boundary access
Wright Feng (3):
brcmfmac: fix invalid permanent MAC address in wiphy
brcmfmac: keep SDIO watchdog running when console_interval is non-zero
brcmfmac: reduce maximum station interface from 2 to 1 in RSDB mode
.../net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 8 ++++---- drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c | 2 +- .../net/wireless/broadcom/brcm80211/brcmfmac/fwil_types.h | 2 +- .../net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c | 3 +++ drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 6 +++++- 5 files changed, 14 insertions(+), 7 deletions(-)
Signature · 1 line
2.25.0
PATCH v2 1/5 brcmfmac: To fix kernel crash on out of boundary access
From: Raveendran Somu <[email protected]>
To truncate the additional bytes, if extra bytes have been received. Current code only have a warning and proceed without handling it. But in one of the crash reported by DVT, these causes the crash intermittently. So the processing is limit to the skb->len.
---
v2:
- Correct all typos in commit message
drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c +3 -0
@@ -1843,6 +1843,9 @@ void brcmf_fws_hdrpull(struct brcmf_if *ifp, s16 siglen, struct sk_buff *skb)WARN_ON (siglen > skb->len); +if (siglen > skb->len) + siglen = skb->len; +if (!siglen)return ;/* if flow control disabled, skip to packet data and leave */
Signature · 1 line
2.25.0
PATCH v2 2/5 brcmfmac: fix invalid permanent MAC address in wiphy
In reply to Wright FengWhen host driver retrieves mac addresses from dongle, driver copies memory from drvr->mac to perm_addr. But at the moment, drvr->mac is all zero array which causes permanent MAC address in wiphy is all zero as well. To fix this, we set drvr->mac before setting perm_addr.
---
v2:
- Correct the typo in commit subject
drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c +1 -1
@@ -209,8 +209,8 @@ int brcmf_c_preinit_dcmds(struct brcmf_if *ifp)bphy_err (drvr,"Retrieving cur_etheraddr failed, %d\n" , err); goto done; } -memcpy (ifp->drvr->wiphy->perm_addr, ifp->drvr->mac,ETH_ALEN );memcpy (ifp->drvr->mac, ifp->mac_addr,sizeof (ifp->drvr->mac)); +memcpy (ifp->drvr->wiphy->perm_addr, ifp->drvr->mac,ETH_ALEN ); bus = ifp->drvr->bus_if; ri = &ifp->drvr->revinfo;
Signature · 1 line
2.25.0
PATCH v2 3/5 brcmfmac: keep SDIO watchdog running when console_interval is non-zero
In reply to Wright Fengbrcmfmac host driver makes SDIO bus sleep and stops SDIO watchdog if no pending event or data. As a result, host driver does not poll firmware console buffer before buffer overflow, which leads to missing firmware logs. We should not stop SDIO watchdog if console_interval is non-zero in debug build.
--- drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +5 -1
@@ -3686,7 +3686,11 @@ static void brcmf_sdio_bus_watchdog(struct brcmf_sdio *bus)if (bus->idlecount > bus->idletime) {brcmf_dbg (SDIO ,"idle\n" );sdio_claim_host (bus->sdiodev->func1); -brcmf_sdio_wd_timer (bus, false); +#ifdef DEBUG +if (!BRCMF_FWCON_ON () || + bus->console_interval == 0) +#endif +brcmf_sdio_wd_timer (bus, false); bus->idlecount =0 ;brcmf_sdio_bus_sleep (bus, true, false);sdio_release_host (bus->sdiodev->func1);
Signature · 1 line
2.25.0
PATCH v2 4/5 brcmfmac: reduce maximum station interface from 2 to 1 in RSDB mode
In reply to Wright FengThe firmware state machines are not fully suitable for concurrent station interface support, it may hit unexpected error if we have 2 different SSIDs and the roaming scenarios concurrently. To avoid the bad user-experience if this is not fully validated, we dis-allow user to create two concurrent station interfaces.
--- .../net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +4 -4
@@ -6801,7 +6801,7 @@ brcmf_txrx_stypes[NUM_NL80211_IFTYPES] = {* #AP <= 4, matching BI, channels = 1, 4 total * * no p2p and rsdb: -* #STA <= 2, #AP <= 2, channels = 2, 4 total +* #STA <= 1, #AP <= 2, channels = 2, 4 total * * p2p, no mchan, and mbss: *
@@ -6816,7 +6816,7 @@ brcmf_txrx_stypes[NUM_NL80211_IFTYPES] = {* #AP <= 4, matching BI, channels = 1, 4 total * * p2p, rsdb, and no mbss: -* #STA <= 2, #P2P-DEV <= 1, #{P2P-CL, P2P-GO} <= 2, AP <= 2, +* #STA <= 1, #P2P-DEV <= 1, #{P2P-CL, P2P-GO} <= 2, AP <= 2, * channels = 2, 4 total */ static int brcmf_setup_ifmodes (struct wiphy *wiphy,struct brcmf_if *ifp)
@@ -6857,7 +6857,7 @@ static int brcmf_setup_ifmodes(struct wiphy *wiphy, struct brcmf_if *ifp) goto err; combo[c].num_different_channels =1 + (rsdb || (p2p && mchan)); - c0_limits[i].max =1 + rsdb; + c0_limits[i].max =1 ; c0_limits[i++].types =BIT (NL80211_IFTYPE_STATION );if (mon_flag) { c0_limits[i].max =1 ;
@@ -6873,7 +6873,7 @@ static int brcmf_setup_ifmodes(struct wiphy *wiphy, struct brcmf_if *ifp)if (p2p && rsdb) { c0_limits[i].max =2 ; c0_limits[i++].types =BIT (NL80211_IFTYPE_AP ); - combo[c].max_interfaces =5 ; + combo[c].max_interfaces =4 ; }else if (p2p) { combo[c].max_interfaces = i; }else if (rsdb) {
Signature · 1 line
2.25.0
PATCH v2 5/5 brcmfmac: To fix Bss Info flag definition Bug
In reply to Wright FengFrom: Prasanna Kerekoppa <[email protected]>
Bss info flag definition need to be fixed from 0x2 to 0x4 This flag is for rssi info received on channel.
All Firmware branches defined as 0x4 and this is bug in brcmfmac.
--- drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil_types.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil_types.h +1 -1
@@ -19,7 +19,7 @@#define BRCMF_ARP_OL_PEER_AUTO_REPLY 0x00000008#define BRCMF_BSS_INFO_VERSION 109/* curr ver of brcmf_bss_info_le struct */ -#define BRCMF_BSS_RSSI_ON_CHANNEL 0x0002 +#define BRCMF_BSS_RSSI_ON_CHANNEL 0x0004#define BRCMF_STA_BRCM 0x00000001/* Running a Broadcom driver */ #define BRCMF_STA_WME 0x00000002/* WMM association */
Signature · 1 line
2.25.0
Re: [PATCH v2 1/5] brcmfmac: To fix kernel crash on out of boundary access
In reply to Wright FengQuoted 10 lines · Wright Feng
From: Raveendran Somu <[email protected]>
To truncate the additional bytes, if extra bytes have been received. Current code only have a warning and proceed without handling it. But in one of the crash reported by DVT, these causes the crash intermittently. So the processing is limit to the
skb->len.Signed-off-by Raveendran Somu <[email protected]>Signed-off-by Chi-hsien Lin <[email protected]>Signed-off-by Wright Feng <[email protected]>
5 patches applied to wireless-drivers-next.git, thanks.
698bae2e6ea1 brcmfmac: To fix kernel crash on out of boundary access 1eb4e9f62998 brcmfmac: fix invalid permanent MAC address in wiphy eccbf46b15bb brcmfmac: keep SDIO watchdog running when console_interval is non-zero ec3428bb8915 brcmfmac: reduce maximum station interface from 2 to 1 in RSDB mode fa3266541b13 brcmfmac: To fix Bss Info flag definition Bug
Signature · 3 lines
https://patchwork.kernel.org/patch/11587075/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches