331-v4.18-0008-brcmfmac-trigger-memory-dump-upon-firmware-halt-sign.patch 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. From 8a3ab2f38f1669e3be6433a1f6b82a077b38c4c7 Mon Sep 17 00:00:00 2001
  2. From: Franky Lin <franky.lin@broadcom.com>
  3. Date: Wed, 16 May 2018 14:12:02 +0200
  4. Subject: [PATCH] brcmfmac: trigger memory dump upon firmware halt signal
  5. PCIe dongle firmware signals a halt/trap through mailbox interrupt.
  6. Trigger a memory dump upon receiving such signal could help to provide
  7. useful information for issue debug.
  8. Reviewed-by: Arend van Spriel <arend.vanspriel@broadcom.com>
  9. Signed-off-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/pcie.c | 5 +++++
  14. 1 file changed, 5 insertions(+)
  15. --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
  16. +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
  17. @@ -180,6 +180,7 @@ static struct brcmf_firmware_mapping brc
  18. #define BRCMF_D2H_DEV_D3_ACK 0x00000001
  19. #define BRCMF_D2H_DEV_DS_ENTER_REQ 0x00000002
  20. #define BRCMF_D2H_DEV_DS_EXIT_NOTE 0x00000004
  21. +#define BRCMF_D2H_DEV_FWHALT 0x10000000
  22. #define BRCMF_H2D_HOST_D3_INFORM 0x00000001
  23. #define BRCMF_H2D_HOST_DS_ACK 0x00000002
  24. @@ -715,6 +716,10 @@ static void brcmf_pcie_handle_mb_data(st
  25. devinfo->mbdata_completed = true;
  26. wake_up(&devinfo->mbdata_resp_wait);
  27. }
  28. + if (dtoh_mb_data & BRCMF_D2H_DEV_FWHALT) {
  29. + brcmf_dbg(PCIE, "D2H_MB_DATA: FW HALT\n");
  30. + brcmf_dev_coredump(&devinfo->pdev->dev);
  31. + }
  32. }