040ab16a6c5f3865d68d4a017e58e8b8dafb716f
[oweals/openwrt.git] /
1 From e0bfb9601d4812719167cc4124a0d6db1e2f55e4 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] 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 Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
14 ---
15  drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c | 7 +++++++
16  1 file changed, 7 insertions(+)
17
18 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c
19 +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c
20 @@ -1398,6 +1398,13 @@ void brcmf_msgbuf_delete_flowring(struct
21         u8 ifidx;
22         int err;
23  
24 +       /* no need to submit if firmware can not be reached */
25 +       if (drvr->bus_if->state != BRCMF_BUS_UP) {
26 +               brcmf_dbg(MSGBUF, "bus down, flowring will be removed\n");
27 +               brcmf_msgbuf_remove_flowring(msgbuf, flowid);
28 +               return;
29 +       }
30 +
31         commonring = msgbuf->commonrings[BRCMF_H2D_MSGRING_CONTROL_SUBMIT];
32         brcmf_commonring_lock(commonring);
33         ret_ptr = brcmf_commonring_reserve_for_write(commonring);