352-v5.4-0006-brcmfmac-simply-remove-flowring-if-bus-is-down.patch 1.3 KB

123456789101112131415161718192021222324252627282930313233
  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. When the bus is down, eg. due to rmmod, there is no need to
  6. attempt to inform firmware about it.
  7. Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
  8. Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
  9. Reviewed-by: Franky Lin <franky.lin@broadcom.com>
  10. Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
  11. Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
  12. ---
  13. drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c | 7 +++++++
  14. 1 file changed, 7 insertions(+)
  15. --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c
  16. +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c
  17. @@ -1406,6 +1406,13 @@ void brcmf_msgbuf_delete_flowring(struct
  18. u8 ifidx;
  19. int err;
  20. + /* no need to submit if firmware can not be reached */
  21. + if (drvr->bus_if->state != BRCMF_BUS_UP) {
  22. + brcmf_dbg(MSGBUF, "bus down, flowring will be removed\n");
  23. + brcmf_msgbuf_remove_flowring(msgbuf, flowid);
  24. + return;
  25. + }
  26. +
  27. commonring = msgbuf->commonrings[BRCMF_H2D_MSGRING_CONTROL_SUBMIT];
  28. brcmf_commonring_lock(commonring);
  29. ret_ptr = brcmf_commonring_reserve_for_write(commonring);