Commit b4bb8469 authored by Hector Martin's avatar Hector Martin Committed by Kalle Valo

brcmfmac: pcie: Read the console on init and shutdown

This allows us to get console messages if the firmware crashed during
early init, or if an operation failed and we're about to shut down.
Reviewed-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Reviewed-by: default avatarArend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: default avatarHector Martin <marcan@marcan.st>
Reviewed-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: default avatarKalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20220131160713.245637-10-marcan@marcan.st
parent e7191182
...@@ -744,6 +744,8 @@ static void brcmf_pcie_bus_console_read(struct brcmf_pciedev_info *devinfo, ...@@ -744,6 +744,8 @@ static void brcmf_pcie_bus_console_read(struct brcmf_pciedev_info *devinfo,
return; return;
console = &devinfo->shared.console; console = &devinfo->shared.console;
if (!console->base_addr)
return;
addr = console->base_addr + BRCMF_CONSOLE_WRITEIDX_OFFSET; addr = console->base_addr + BRCMF_CONSOLE_WRITEIDX_OFFSET;
newidx = brcmf_pcie_read_tcm32(devinfo, addr); newidx = brcmf_pcie_read_tcm32(devinfo, addr);
while (newidx != console->read_idx) { while (newidx != console->read_idx) {
...@@ -1520,6 +1522,7 @@ brcmf_pcie_init_share_ram_info(struct brcmf_pciedev_info *devinfo, ...@@ -1520,6 +1522,7 @@ brcmf_pcie_init_share_ram_info(struct brcmf_pciedev_info *devinfo,
shared->max_rxbufpost, shared->rx_dataoffset); shared->max_rxbufpost, shared->rx_dataoffset);
brcmf_pcie_bus_console_init(devinfo); brcmf_pcie_bus_console_init(devinfo);
brcmf_pcie_bus_console_read(devinfo, false);
return 0; return 0;
} }
...@@ -1959,6 +1962,7 @@ brcmf_pcie_remove(struct pci_dev *pdev) ...@@ -1959,6 +1962,7 @@ brcmf_pcie_remove(struct pci_dev *pdev)
return; return;
devinfo = bus->bus_priv.pcie->devinfo; devinfo = bus->bus_priv.pcie->devinfo;
brcmf_pcie_bus_console_read(devinfo, false);
devinfo->state = BRCMFMAC_PCIE_STATE_DOWN; devinfo->state = BRCMFMAC_PCIE_STATE_DOWN;
if (devinfo->ci) if (devinfo->ci)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment