0861deb024ce0499fd81b2436704a8564f5d369c
[oweals/openwrt.git] /
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
6 Attempt to dump dongle memory for debug upon receiving firmware halt
7 message through dongle to host mail box interrupt.
8
9 Reviewed-by: Arend van Spriel <arend.vanspriel@broadcom.com>
10 Signed-off-by: Franky Lin <franky.lin@broadcom.com>
11 Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
12 Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
13 ---
14  drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 4 +++-
15  1 file changed, 3 insertions(+), 1 deletion(-)
16
17 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
18 +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
19 @@ -1095,8 +1095,10 @@ static u32 brcmf_sdio_hostmail(struct br
20         bus->sdcnt.f1regdata += 2;
21  
22         /* dongle indicates the firmware has halted/crashed */
23 -       if (hmb_data & HMB_DATA_FWHALT)
24 +       if (hmb_data & HMB_DATA_FWHALT) {
25                 brcmf_err("mailbox indicates firmware halted\n");
26 +               brcmf_dev_coredump(&sdiod->func1->dev);
27 +       }
28  
29         /* Dongle recomposed rx frames, accept them again */
30         if (hmb_data & HMB_DATA_NAKHANDLED) {