2022-02-01 20:44:01

by Hector Martin

[permalink] [raw]
Subject: [PATCH v4 0/9] misc brcmfmac fixes (M1/T2 series spin-off)

Hi everyone,

This series contains just the fixes / misc improvements from the
previously submitted series:

brcmfmac: Support Apple T2 and M1 platforms

Patches 8-9 aren't strictly bugfixes but rather just general
improvements; they can be safely skipped, although patch 8 will be a
dependency of the subsequent series to avoid a compile warning.

Changes since v3:
- Sprinkled Cc: stable tags on all the commits that fix real bugs
- Added review tags
- Removed error message on alloc failure path in #7

Hector Martin (9):
brcmfmac: pcie: Release firmwares in the brcmf_pcie_setup error path
brcmfmac: firmware: Allocate space for default boardrev in nvram
brcmfmac: firmware: Do not crash on a NULL board_type
brcmfmac: pcie: Declare missing firmware files in pcie.c
brcmfmac: pcie: Replace brcmf_pcie_copy_mem_todev with memcpy_toio
brcmfmac: pcie: Fix crashes due to early IRQs
brcmfmac: of: Use devm_kstrdup for board_type & check for errors
brcmfmac: fwil: Constify iovar name arguments
brcmfmac: pcie: Read the console on init and shutdown

.../broadcom/brcm80211/brcmfmac/firmware.c | 5 ++
.../broadcom/brcm80211/brcmfmac/fwil.c | 34 ++++----
.../broadcom/brcm80211/brcmfmac/fwil.h | 28 +++----
.../wireless/broadcom/brcm80211/brcmfmac/of.c | 7 +-
.../broadcom/brcm80211/brcmfmac/pcie.c | 77 ++++++++-----------
.../broadcom/brcm80211/brcmfmac/sdio.c | 1 -
6 files changed, 71 insertions(+), 81 deletions(-)

--
2.33.0


2022-02-01 20:44:07

by Hector Martin

[permalink] [raw]
Subject: [PATCH v4 9/9] 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: Linus Walleij <[email protected]>
Reviewed-by: Arend van Spriel <[email protected]>
Signed-off-by: Hector Martin <[email protected]>
---
drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
index 3ff4997e1c97..4fe341376a16 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
@@ -744,6 +744,8 @@ static void brcmf_pcie_bus_console_read(struct brcmf_pciedev_info *devinfo,
return;

console = &devinfo->shared.console;
+ if (!console->base_addr)
+ return;
addr = console->base_addr + BRCMF_CONSOLE_WRITEIDX_OFFSET;
newidx = brcmf_pcie_read_tcm32(devinfo, addr);
while (newidx != console->read_idx) {
@@ -1520,6 +1522,7 @@ brcmf_pcie_init_share_ram_info(struct brcmf_pciedev_info *devinfo,
shared->max_rxbufpost, shared->rx_dataoffset);

brcmf_pcie_bus_console_init(devinfo);
+ brcmf_pcie_bus_console_read(devinfo, false);

return 0;
}
@@ -1959,6 +1962,7 @@ brcmf_pcie_remove(struct pci_dev *pdev)
return;

devinfo = bus->bus_priv.pcie->devinfo;
+ brcmf_pcie_bus_console_read(devinfo, false);

devinfo->state = BRCMFMAC_PCIE_STATE_DOWN;
if (devinfo->ci)
--
2.33.0