Return-path: Received: from rnd-relay.smtp.broadcom.com ([192.19.229.170]:48298 "EHLO rnd-relay.smtp.broadcom.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752482AbeEPMMc (ORCPT ); Wed, 16 May 2018 08:12:32 -0400 From: Arend van Spriel To: Kalle Valo Cc: linux-wireless@vger.kernel.org, Franky Lin , Arend van Spriel Subject: [PATCH V2 5/6] brcmfmac: trigger memory dump upon firmware halt signal Date: Wed, 16 May 2018 14:12:02 +0200 Message-Id: <1526472723-15758-6-git-send-email-arend.vanspriel@broadcom.com> (sfid-20180516_141242_084146_5FF059B4) In-Reply-To: <1526472723-15758-1-git-send-email-arend.vanspriel@broadcom.com> References: <1526472723-15758-1-git-send-email-arend.vanspriel@broadcom.com> Sender: linux-wireless-owner@vger.kernel.org List-ID: From: Franky Lin PCIe dongle firmware signals a halt/trap through mailbox interrupt. Trigger a memory dump upon receiving such signal could help to provide useful information for issue debug. Reviewed-by: Arend van Spriel Signed-off-by: Franky Lin Signed-off-by: Arend van Spriel --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c index 5baa837..45928b5 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c @@ -182,6 +182,7 @@ enum brcmf_pcie_state { #define BRCMF_D2H_DEV_D3_ACK 0x00000001 #define BRCMF_D2H_DEV_DS_ENTER_REQ 0x00000002 #define BRCMF_D2H_DEV_DS_EXIT_NOTE 0x00000004 +#define BRCMF_D2H_DEV_FWHALT 0x10000000 #define BRCMF_H2D_HOST_D3_INFORM 0x00000001 #define BRCMF_H2D_HOST_DS_ACK 0x00000002 @@ -717,6 +718,10 @@ static void brcmf_pcie_handle_mb_data(struct brcmf_pciedev_info *devinfo) devinfo->mbdata_completed = true; wake_up(&devinfo->mbdata_resp_wait); } + if (dtoh_mb_data & BRCMF_D2H_DEV_FWHALT) { + brcmf_dbg(PCIE, "D2H_MB_DATA: FW HALT\n"); + brcmf_dev_coredump(&devinfo->pdev->dev); + } } -- 1.9.1