On 2/26/2019 2:11 PM, Rafał Miłecki wrote:
From: Rafał Miłecki <[email protected]>

It's important as brcmf_chip_get_raminfo() also makes sure that memory
is properly setup. Without it the firmware could report invalid RAM
address like 0x04000001.

During a normal brcmfmac lifetime brcmf_chip_get_raminfo() is called on
probe by the brcmf_chip_recognition(). This change allows implementing
further improvements like handling errors by resetting a device with
the brcmf_pcie_reset_device() and redownloading a firmware afterwards.

Thanks, Rafał

How about avoiding the ramsize adjustment in redownloading scenario. We could add a reinit field in devinfo and check that.

        /* Some of the firmwares have the size of the memory of the device
         * defined inside the firmware. This is because part of the memory in
         * the device is shared and the devision is determined by FW. Parse
         * the firmware and adjust the chip memory size now.
         */
        if (!devinfo->reinit)
                brcmf_pcie_adjust_ramsize(devinfo, (u8 *)fw->data, fw->size);

Regards,
Arend

Signed-off-by: Rafał Miłecki <[email protected]>
---
  drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c | 6 ++++--
  drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.h | 1 +
  drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c | 6 ++++++
  3 files changed, 11 insertions(+), 2 deletions(-)

Reply via email to