331-v4.18-0009-brcmfmac-trigger-memory-dump-on-SDIO-firmware-halt-m.patch 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. From b8248236e92790ac635caeb4156e46ea2417e037 Mon Sep 17 00:00:00 2001
  2. From: Franky Lin <franky.lin@broadcom.com>
  3. Date: Wed, 16 May 2018 14:12:03 +0200
  4. Subject: [PATCH] brcmfmac: trigger memory dump on SDIO firmware halt message
  5. Attempt to dump dongle memory for debug upon receiving firmware halt
  6. message through dongle to host mail box interrupt.
  7. Reviewed-by: Arend van Spriel <arend.vanspriel@broadcom.com>
  8. Signed-off-by: Franky Lin <franky.lin@broadcom.com>
  9. Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
  10. Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
  11. [rmilecki: add sdiod variable and use func[1]]
  12. Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
  13. ---
  14. drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 4 +++-
  15. 1 file changed, 3 insertions(+), 1 deletion(-)
  16. --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
  17. +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
  18. @@ -1079,6 +1079,7 @@ static void brcmf_sdio_get_console_addr(
  19. static u32 brcmf_sdio_hostmail(struct brcmf_sdio *bus)
  20. {
  21. + struct brcmf_sdio_dev *sdiod = bus->sdiodev;
  22. u32 intstatus = 0;
  23. u32 hmb_data;
  24. u8 fcbits;
  25. @@ -1096,8 +1097,10 @@ static u32 brcmf_sdio_hostmail(struct br
  26. bus->sdcnt.f1regdata += 2;
  27. /* dongle indicates the firmware has halted/crashed */
  28. - if (hmb_data & HMB_DATA_FWHALT)
  29. + if (hmb_data & HMB_DATA_FWHALT) {
  30. brcmf_err("mailbox indicates firmware halted\n");
  31. + brcmf_dev_coredump(&sdiod->func[1]->dev);
  32. + }
  33. /* Dongle recomposed rx frames, accept them again */
  34. if (hmb_data & HMB_DATA_NAKHANDLED) {