OSDN Git Service

brcmfmac: get chip's default RAM info during PCIe setup
authorRafał Miłecki <rafal@milecki.pl>
Thu, 29 Aug 2019 08:27:01 +0000 (10:27 +0200)
committerKalle Valo <kvalo@codeaurora.org>
Tue, 3 Sep 2019 13:44:56 +0000 (16:44 +0300)
commit82f93cf46d6007ffa003b2d4a2834563b6b84d21
treeaf89e9848080b662456774bc3f5510252922e2d6
parent420c20be08a4597404d272ae9793b642401146eb
brcmfmac: get chip's default RAM info during PCIe setup

Getting RAM info just once per driver's lifetime (during chip
recognition) is not enough as it may get adjusted later (depending on
the used firmware). Subsequent inits may load different firmwares so a
full RAM recognition is required on every PCIe setup. This is especially
important since implementing hardware reset on a firmware crash.

Moreover calling brcmf_chip_get_raminfo() makes sure that RAM core is
up. It's important as having BCMA_CORE_SYS_MEM down on BCM4366 was
resulting in firmware failing to initialize and following error:
[   65.657546] brcmfmac 0000:01:00.0: brcmf_pcie_download_fw_nvram: Invalid shared RAM address 0x04000001

This change makes brcmf_chip_get_raminfo() call during chip recognition
redundant for PCIe devices but SDIO and USB still need it and it's a
very small overhead anyway.

Fixes: 4684997d9eea ("brcmfmac: reset PCIe bus on a firmware crash")
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c
drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.h
drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c