brcmfmac: dump dongle memory when attaching failed

To enhance FW debugging, we add dongle memory dump when hitting attaching
failure with PCIE bus. It can help developer to get more information
about dongle trap reason and root cause.

Signed-off-by: Wright Feng <wright.feng@cypress.com>
Signed-off-by: Chi-hsien Lin <chi-hsien.lin@cypress.com>
Signed-off-by: Ian Lin <ian.lin@infineon.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20220929031001.9962-4-ian.lin@infineon.com
This commit is contained in:
Wright Feng
2022-09-28 22:10:01 -05:00
committed by Kalle Valo
parent 2aca4f3734
commit 5671c8b56c
2 changed files with 9 additions and 4 deletions

View File

@@ -1399,7 +1399,8 @@ void brcmf_fw_crashed(struct device *dev)
brcmf_dev_coredump(dev);
schedule_work(&drvr->bus_reset);
if (drvr->bus_reset.func)
schedule_work(&drvr->bus_reset);
}
void brcmf_detach(struct device *dev)

View File

@@ -2068,13 +2068,14 @@ static void brcmf_pcie_setup(struct device *dev, int ret,
struct brcmf_commonring **flowrings;
u32 i, nvram_len;
bus = dev_get_drvdata(dev);
pcie_bus_dev = bus->bus_priv.pcie;
devinfo = pcie_bus_dev->devinfo;
/* check firmware loading result */
if (ret)
goto fail;
bus = dev_get_drvdata(dev);
pcie_bus_dev = bus->bus_priv.pcie;
devinfo = pcie_bus_dev->devinfo;
brcmf_pcie_attach(devinfo);
fw = fwreq->items[BRCMF_PCIE_FW_CODE].binary;
@@ -2148,6 +2149,9 @@ static void brcmf_pcie_setup(struct device *dev, int ret,
return;
fail:
brcmf_err(bus, "Dongle setup failed\n");
brcmf_pcie_bus_console_read(devinfo, true);
brcmf_fw_crashed(dev);
device_release_driver(dev);
}