328-v4.15-0002-brcmfmac-handle-FWHALT-mailbox-indication.patch 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. From 2fd3877b5bb7d39782c3205a1dcda02023b8514a Mon Sep 17 00:00:00 2001
  2. From: Arend Van Spriel <arend.vanspriel@broadcom.com>
  3. Date: Wed, 8 Nov 2017 14:36:31 +0100
  4. Subject: [PATCH] brcmfmac: handle FWHALT mailbox indication
  5. The firmware uses a mailbox to communicate to the host what is going
  6. on. In the driver we validate the bit received. Various people seen
  7. the following message:
  8. brcmfmac: brcmf_sdio_hostmail: Unknown mailbox data content: 0x40012
  9. Bit 4 is cause of this message, but this actually indicates the firmware
  10. has halted. Handle this bit by giving a more meaningful error message.
  11. Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
  12. Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
  13. Reviewed-by: Franky Lin <franky.lin@broadcom.com>
  14. Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
  15. Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
  16. ---
  17. drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 14 ++++++++++----
  18. 1 file changed, 10 insertions(+), 4 deletions(-)
  19. --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
  20. +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
  21. @@ -260,10 +260,11 @@ struct rte_console {
  22. #define I_HMB_HOST_INT I_HMB_SW3 /* Miscellaneous Interrupt */
  23. /* tohostmailboxdata */
  24. -#define HMB_DATA_NAKHANDLED 1 /* retransmit NAK'd frame */
  25. -#define HMB_DATA_DEVREADY 2 /* talk to host after enable */
  26. -#define HMB_DATA_FC 4 /* per prio flowcontrol update flag */
  27. -#define HMB_DATA_FWREADY 8 /* fw ready for protocol activity */
  28. +#define HMB_DATA_NAKHANDLED 0x0001 /* retransmit NAK'd frame */
  29. +#define HMB_DATA_DEVREADY 0x0002 /* talk to host after enable */
  30. +#define HMB_DATA_FC 0x0004 /* per prio flowcontrol update flag */
  31. +#define HMB_DATA_FWREADY 0x0008 /* fw ready for protocol activity */
  32. +#define HMB_DATA_FWHALT 0x0010 /* firmware halted */
  33. #define HMB_DATA_FCDATA_MASK 0xff000000
  34. #define HMB_DATA_FCDATA_SHIFT 24
  35. @@ -1094,6 +1095,10 @@ static u32 brcmf_sdio_hostmail(struct br
  36. offsetof(struct sdpcmd_regs, tosbmailbox));
  37. bus->sdcnt.f1regdata += 2;
  38. + /* dongle indicates the firmware has halted/crashed */
  39. + if (hmb_data & HMB_DATA_FWHALT)
  40. + brcmf_err("mailbox indicates firmware halted\n");
  41. +
  42. /* Dongle recomposed rx frames, accept them again */
  43. if (hmb_data & HMB_DATA_NAKHANDLED) {
  44. brcmf_dbg(SDIO, "Dongle reports NAK handled, expect rtx of %d\n",
  45. @@ -1151,6 +1156,7 @@ static u32 brcmf_sdio_hostmail(struct br
  46. HMB_DATA_NAKHANDLED |
  47. HMB_DATA_FC |
  48. HMB_DATA_FWREADY |
  49. + HMB_DATA_FWHALT |
  50. HMB_DATA_FCDATA_MASK | HMB_DATA_VERSION_MASK))
  51. brcmf_err("Unknown mailbox data content: 0x%02x\n",
  52. hmb_data);