Skip to contentSkip to conversation

brcmfmac: fix regression in parsing NVRAM for multiple devices

PATCH In review Rafał Miłecki 3 participants 4 messages Jul 22, 2018 – Jul 25, 2018 Broadcom BRCM80211 IEEE802.11 wireless drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 brcmfmac: fix regression in parsing NVRAM for multiple devices

From: Rafał Miłecki <[email protected]>

NVRAM is designed to work with Broadcom's SDK Linux kernel which fakes PCI domain 0 for all internal MMIO devices. Since official Linux kernel uses platform devices for that purpose there is a mismatch in numbering PCI domains.

There used to be a fix for that problem but it was accidentally dropped during the last firmware loading rework. That resulted in brcmfmac not being able to extract device specific NVRAM content and all kind of calibration problems.

Fixes 2baa3aaee27f ("brcmfmac: introduce brcmf_fw_alloc_request() function")
Cc [email protected] # v4.17+
---
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c +2 -1
index 45928b5b8d97..4fffa6988087 100644
@@ -1785,7 +1785,8 @@ brcmf_pcie_prepare_fw_request(struct brcmf_pciedev_info *devinfo)
 	fwreq->items[BRCMF_PCIE_FW_CODE].type = BRCMF_FW_TYPE_BINARY;
 	fwreq->items[BRCMF_PCIE_FW_NVRAM].type = BRCMF_FW_TYPE_NVRAM;
 	fwreq->items[BRCMF_PCIE_FW_NVRAM].flags = BRCMF_FW_REQF_OPTIONAL;
-	fwreq->domain_nr = pci_domain_nr(devinfo->pdev->bus);
+	/* NVRAM reserves PCI domain 0 for Broadcom's SDK faked bus */
+	fwreq->domain_nr = pci_domain_nr(devinfo->pdev->bus) + 1;
 	fwreq->bus_nr = devinfo->pdev->bus->number;
 
 	return fwreq;
Signature · 1 line
2.13.7
#1 lore raw
Quoted 7 lines · Rafa=C5=82 Mi=C5=82ecki <[email protected]> writes:

From: Rafa=C5=82 Mi=C5=82ecki <[email protected]>

NVRAM is designed to work with Broadcom's SDK Linux kernel which fakes PCI domain 0 for all internal MMIO devices. Since official Linux kernel uses platform devices for that purpose there is a mismatch in numbering PCI domains.

Quoted 7 lines

There used to be a fix for that problem but it was accidentally dropped during the last firmware loading rework. That resulted in brcmfmac not being able to extract device specific NVRAM content and all kind of calibration problems.

Fixes 2baa3aaee27f ("brcmfmac: introduce brcmf_fw_alloc_request() functi=

on")

Quoted 2 lines

I'll queue this to 4.18 (if there's still time). I just came from vacation and have some catching up to do :)

--=20
Kalle Valo

maintainer Acked-by on v1 1/1
#2 lore raw
In reply to Rafał Miłecki
Quoted 7 lines · Rafał Miłecki

From: Rafał Miłecki <[email protected]>

NVRAM is designed to work with Broadcom's SDK Linux kernel which fakes PCI domain 0 for all internal MMIO devices. Since official Linux kernel uses platform devices for that purpose there is a mismatch in numbering PCI domains.

Quoted 8 lines

There used to be a fix for that problem but it was accidentally dropped during the last firmware loading rework. That resulted in brcmfmac not being able to extract device specific NVRAM content and all kind of calibration problems.

Fixes 2baa3aaee27f ("brcmfmac: introduce brcmf_fw_alloc_request() function")
Cc [email protected] # v4.17+

oops. my bad.

Quoted 20 lines
---
  drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c +2 -1
index 45928b5b8d97..4fffa6988087 100644
@@ -1785,7 +1785,8 @@ brcmf_pcie_prepare_fw_request(struct brcmf_pciedev_info *devinfo)
  	fwreq->items[BRCMF_PCIE_FW_CODE].type = BRCMF_FW_TYPE_BINARY;
  	fwreq->items[BRCMF_PCIE_FW_NVRAM].type = BRCMF_FW_TYPE_NVRAM;
  	fwreq->items[BRCMF_PCIE_FW_NVRAM].flags = BRCMF_FW_REQF_OPTIONAL;
-	fwreq->domain_nr = pci_domain_nr(devinfo->pdev->bus);
+	/* NVRAM reserves PCI domain 0 for Broadcom's SDK faked bus */
+	fwreq->domain_nr = pci_domain_nr(devinfo->pdev->bus) + 1;
  	fwreq->bus_nr = devinfo->pdev->bus->number;
 
  	return fwreq;
#3 lore raw
In reply to Rafał Miłecki
Quoted 12 lines · Rafał Miłecki

From: Rafał Miłecki <[email protected]>

NVRAM is designed to work with Broadcom's SDK Linux kernel which fakes PCI domain 0 for all internal MMIO devices. Since official Linux kernel uses platform devices for that purpose there is a mismatch in numbering PCI domains.

There used to be a fix for that problem but it was accidentally dropped during the last firmware loading rework. That resulted in brcmfmac not being able to extract device specific NVRAM content and all kind of calibration problems.

Quoted 5 lines
Fixes 2baa3aaee27f ("brcmfmac: introduce brcmf_fw_alloc_request() function")
Cc [email protected] # v4.17+

Patch applied to wireless-drivers.git, thanks.

299b6365a3b7 brcmfmac: fix regression in parsing NVRAM for multiple devices

Signature · 3 lines
https://patchwork.kernel.org/patch/10539435/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches