351-0027-brcmfmac-restore-stopping-netdev-queue-when-bus-clog.patch 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. From: Arend Van Spriel <arend.vanspriel@broadcom.com>
  2. Date: Fri, 15 Jul 2016 12:16:12 +0200
  3. Subject: [PATCH] brcmfmac: restore stopping netdev queue when bus clogs up
  4. MIME-Version: 1.0
  5. Content-Type: text/plain; charset=UTF-8
  6. Content-Transfer-Encoding: 8bit
  7. When the host-interface bus has hard time handling transmit packets
  8. it informs higher layer about this and it would stop the netdev
  9. queue when needed. However, since commit 9cd18359d31e ("brcmfmac:
  10. Make FWS queueing configurable.") this was broken. With this patch
  11. the behaviour is restored.
  12. Cc: stable@vger.kernel.org # v4.5, v4.6, v4.7
  13. Fixes: 9cd18359d31e ("brcmfmac: Make FWS queueing configurable.")
  14. Tested-by: Per Förlin <per.forlin@gmail.com>
  15. Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
  16. Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
  17. Reviewed-by: Franky Lin <franky.lin@broadcom.com>
  18. Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
  19. Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
  20. ---
  21. --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c
  22. +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c
  23. @@ -2469,10 +2469,22 @@ void brcmf_fws_bustxfail(struct brcmf_fw
  24. void brcmf_fws_bus_blocked(struct brcmf_pub *drvr, bool flow_blocked)
  25. {
  26. struct brcmf_fws_info *fws = drvr->fws;
  27. + struct brcmf_if *ifp;
  28. + int i;
  29. - fws->bus_flow_blocked = flow_blocked;
  30. - if (!flow_blocked)
  31. - brcmf_fws_schedule_deq(fws);
  32. - else
  33. - fws->stats.bus_flow_block++;
  34. + if (fws->avoid_queueing) {
  35. + for (i = 0; i < BRCMF_MAX_IFS; i++) {
  36. + ifp = drvr->iflist[i];
  37. + if (!ifp || !ifp->ndev)
  38. + continue;
  39. + brcmf_txflowblock_if(ifp, BRCMF_NETIF_STOP_REASON_FLOW,
  40. + flow_blocked);
  41. + }
  42. + } else {
  43. + fws->bus_flow_blocked = flow_blocked;
  44. + if (!flow_blocked)
  45. + brcmf_fws_schedule_deq(fws);
  46. + else
  47. + fws->stats.bus_flow_block++;
  48. + }
  49. }