a24fe38947c9947070e601d724b44f7ad1e7e412
[openwrt/staging/mkresin.git] /
1 From dabf1e17d33e087d4e24e6d0224cf9bc04ebfcc1 Mon Sep 17 00:00:00 2001
2 From: Arend van Spriel <arend.vanspriel@broadcom.com>
3 Date: Thu, 11 Jul 2019 11:05:11 +0200
4 Subject: [PATCH 6/7] brcmfmac: simply remove flowring if bus is down
5
6 When the bus is down, eg. due to rmmod, there is no need to
7 attempt to inform firmware about it.
8
9 Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
10 Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
11 Reviewed-by: Franky Lin <franky.lin@broadcom.com>
12 Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
13 ---
14 drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c | 7 +++++++
15 1 file changed, 7 insertions(+)
16
17 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c
18 +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c
19 @@ -1398,6 +1398,13 @@ void brcmf_msgbuf_delete_flowring(struct
20 u8 ifidx;
21 int err;
22
23 + /* no need to submit if firmware can not be reached */
24 + if (drvr->bus_if->state != BRCMF_BUS_UP) {
25 + brcmf_dbg(MSGBUF, "bus down, flowring will be removed\n");
26 + brcmf_msgbuf_remove_flowring(msgbuf, flowid);
27 + return;
28 + }
29 +
30 commonring = msgbuf->commonrings[BRCMF_H2D_MSGRING_CONTROL_SUBMIT];
31 brcmf_commonring_lock(commonring);
32 ret_ptr = brcmf_commonring_reserve_for_write(commonring);