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
6 Attempt to dump dongle memory for debug upon receiving firmware halt
7 message through dongle to host mail box interrupt.
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 [rmilecki: add sdiod variable and use func[1]]
14 Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
16 drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 4 +++-
17 1 file changed, 3 insertions(+), 1 deletion(-)
19 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
20 +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
21 @@ -1078,6 +1078,7 @@ static void brcmf_sdio_get_console_addr(
23 static u32 brcmf_sdio_hostmail(struct brcmf_sdio *bus)
25 + struct brcmf_sdio_dev *sdiod = bus->sdiodev;
29 @@ -1095,8 +1096,10 @@ static u32 brcmf_sdio_hostmail(struct br
30 bus->sdcnt.f1regdata += 2;
32 /* dongle indicates the firmware has halted/crashed */
33 - if (hmb_data & HMB_DATA_FWHALT)
34 + if (hmb_data & HMB_DATA_FWHALT) {
35 brcmf_err("mailbox indicates firmware halted\n");
36 + brcmf_dev_coredump(&sdiod->func[1]->dev);
39 /* Dongle recomposed rx frames, accept them again */
40 if (hmb_data & HMB_DATA_NAKHANDLED) {