From db8e08a5a4469f98ed5d9b0ff3189e356f53d924 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Sun, 21 Jul 2019 11:23:32 +0200 Subject: mac80211: brcm: backport first set of 5.4 brcmfmac changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This doesn't include 9ff8614a3dbe ("brcmfmac: use separate Kconfig file for brcmfmac") due to a few conflicts with backports changes. An important change is: [PATCH 2/7] brcmfmac: change the order of things in brcmf_detach() which fixes a rmmod crash in the brcmf_txfinalize(). Signed-off-by: Rafał Miłecki --- ...-avoid-firmware-commands-when-bus-is-down.patch | 78 ++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 package/kernel/mac80211/patches/brcm/104-v5.4-0005-brcmfmac-avoid-firmware-commands-when-bus-is-down.patch (limited to 'package/kernel/mac80211/patches/brcm/104-v5.4-0005-brcmfmac-avoid-firmware-commands-when-bus-is-down.patch') diff --git a/package/kernel/mac80211/patches/brcm/104-v5.4-0005-brcmfmac-avoid-firmware-commands-when-bus-is-down.patch b/package/kernel/mac80211/patches/brcm/104-v5.4-0005-brcmfmac-avoid-firmware-commands-when-bus-is-down.patch new file mode 100644 index 0000000000..e7f42630b8 --- /dev/null +++ b/package/kernel/mac80211/patches/brcm/104-v5.4-0005-brcmfmac-avoid-firmware-commands-when-bus-is-down.patch @@ -0,0 +1,78 @@ +From 66ab63fbb33bf367807e3e471231379dce6f8b8c Mon Sep 17 00:00:00 2001 +From: Arend van Spriel +Date: Thu, 11 Jul 2019 11:05:10 +0200 +Subject: [PATCH 5/7] brcmfmac: avoid firmware commands when bus is down + +Upon rmmod a few attempts are made to inform firmware, but there is +no point as the bus is down and these will fail. Avoid them to keep +the logs clean. + +Reported-by: Stefan Wahren +Reviewed-by: Hante Meuleman +Reviewed-by: Pieter-Paul Giesberts +Reviewed-by: Franky Lin +Signed-off-by: Arend van Spriel +--- + .../broadcom/brcm80211/brcmfmac/cfg80211.c | 23 +++++++++++-------- + 1 file changed, 13 insertions(+), 10 deletions(-) + +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +@@ -1286,17 +1286,21 @@ static void brcmf_link_down(struct brcmf + { + struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(vif->wdev.wiphy); + struct brcmf_pub *drvr = cfg->pub; ++ bool bus_up = drvr->bus_if->state == BRCMF_BUS_UP; + s32 err = 0; + + brcmf_dbg(TRACE, "Enter\n"); + + if (test_and_clear_bit(BRCMF_VIF_STATUS_CONNECTED, &vif->sme_state)) { +- brcmf_dbg(INFO, "Call WLC_DISASSOC to stop excess roaming\n"); +- err = brcmf_fil_cmd_data_set(vif->ifp, +- BRCMF_C_DISASSOC, NULL, 0); +- if (err) { +- bphy_err(drvr, "WLC_DISASSOC failed (%d)\n", err); ++ if (bus_up) { ++ brcmf_dbg(INFO, "Call WLC_DISASSOC to stop excess roaming\n"); ++ err = brcmf_fil_cmd_data_set(vif->ifp, ++ BRCMF_C_DISASSOC, NULL, 0); ++ if (err) ++ bphy_err(drvr, "WLC_DISASSOC failed (%d)\n", ++ err); + } ++ + if ((vif->wdev.iftype == NL80211_IFTYPE_STATION) || + (vif->wdev.iftype == NL80211_IFTYPE_P2P_CLIENT)) + cfg80211_disconnected(vif->wdev.netdev, reason, NULL, 0, +@@ -1306,7 +1310,8 @@ static void brcmf_link_down(struct brcmf + clear_bit(BRCMF_SCAN_STATUS_SUPPRESS, &cfg->scan_status); + brcmf_btcoex_set_mode(vif, BRCMF_BTCOEX_ENABLED, 0); + if (vif->profile.use_fwsup != BRCMF_PROFILE_FWSUP_NONE) { +- brcmf_set_pmk(vif->ifp, NULL, 0); ++ if (bus_up) ++ brcmf_set_pmk(vif->ifp, NULL, 0); + vif->profile.use_fwsup = BRCMF_PROFILE_FWSUP_NONE; + } + brcmf_dbg(TRACE, "Exit\n"); +@@ -5004,18 +5009,16 @@ static int brcmf_cfg80211_get_channel(st + struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); + struct net_device *ndev = wdev->netdev; + struct brcmf_pub *drvr = cfg->pub; +- struct brcmf_if *ifp; + struct brcmu_chan ch; + enum nl80211_band band = 0; + enum nl80211_chan_width width = 0; + u32 chanspec; + int freq, err; + +- if (!ndev) ++ if (!ndev || drvr->bus_if->state != BRCMF_BUS_UP) + return -ENODEV; +- ifp = netdev_priv(ndev); + +- err = brcmf_fil_iovar_int_get(ifp, "chanspec", &chanspec); ++ err = brcmf_fil_iovar_int_get(netdev_priv(ndev), "chanspec", &chanspec); + if (err) { + bphy_err(drvr, "chanspec failed (%d)\n", err); + return err; -- cgit v1.2.3