All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] brcmfmac: fix regression in parsing NVRAM for multiple devices
@ 2018-07-22 21:46 Rafał Miłecki
  2018-07-23  6:43 ` Kalle Valo
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Rafał Miłecki @ 2018-07-22 21:46 UTC (permalink / raw)
  To: Kalle Valo, Arend van Spriel
  Cc: Franky Lin, Hante Meuleman, Chi-Hsien Lin, Wright Feng,
	Pieter-Paul Giesberts, Chung-Hsien Hsu, Aditya Xavier,
	linux-wireless, brcm80211-dev-list.pdl, brcm80211-dev-list,
	Rafał Miłecki

From: Rafał Miłecki <rafal@milecki.pl>

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.

Reported-by: Aditya Xavier <adityaxavier@gmail.com>
Fixes: 2baa3aaee27f ("brcmfmac: introduce brcmf_fw_alloc_request() function")
Cc: stable@vger.kernel.org # v4.17+
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
---
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
index 45928b5b8d97..4fffa6988087 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
@@ -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;
-- 
2.13.7

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] brcmfmac: fix regression in parsing NVRAM for multiple devices
  2018-07-22 21:46 [PATCH] brcmfmac: fix regression in parsing NVRAM for multiple devices Rafał Miłecki
@ 2018-07-23  6:43 ` Kalle Valo
  2018-07-23 12:01 ` Arend van Spriel
  2018-07-25  7:31 ` Kalle Valo
  2 siblings, 0 replies; 4+ messages in thread
From: Kalle Valo @ 2018-07-23  6:43 UTC (permalink / raw)
  To: Rafał Miłecki
  Cc: Arend van Spriel, Franky Lin, Hante Meuleman, Chi-Hsien Lin,
	Wright Feng, Pieter-Paul Giesberts, Chung-Hsien Hsu,
	Aditya Xavier, linux-wireless, brcm80211-dev-list.pdl,
	brcm80211-dev-list, Rafał Miłecki

Rafa=C5=82 Mi=C5=82ecki <zajec5@gmail.com> writes:

> From: Rafa=C5=82 Mi=C5=82ecki <rafal@milecki.pl>
>
> 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.
>
> Reported-by: Aditya Xavier <adityaxavier@gmail.com>
> Fixes: 2baa3aaee27f ("brcmfmac: introduce brcmf_fw_alloc_request() functi=
on")
> Cc: stable@vger.kernel.org # v4.17+
> Signed-off-by: Rafa=C5=82 Mi=C5=82ecki <rafal@milecki.pl>

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] brcmfmac: fix regression in parsing NVRAM for multiple devices
  2018-07-22 21:46 [PATCH] brcmfmac: fix regression in parsing NVRAM for multiple devices Rafał Miłecki
  2018-07-23  6:43 ` Kalle Valo
@ 2018-07-23 12:01 ` Arend van Spriel
  2018-07-25  7:31 ` Kalle Valo
  2 siblings, 0 replies; 4+ messages in thread
From: Arend van Spriel @ 2018-07-23 12:01 UTC (permalink / raw)
  To: Rafał Miłecki, Kalle Valo
  Cc: Franky Lin, Hante Meuleman, Chi-Hsien Lin, Wright Feng,
	Pieter-Paul Giesberts, Chung-Hsien Hsu, Aditya Xavier,
	linux-wireless, brcm80211-dev-list.pdl, brcm80211-dev-list,
	Rafał Miłecki

On 7/22/2018 11:46 PM, Rafał Miłecki wrote:
> From: Rafał Miłecki <rafal@milecki.pl>
>
> 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.
>
> Reported-by: Aditya Xavier <adityaxavier@gmail.com>
> Fixes: 2baa3aaee27f ("brcmfmac: introduce brcmf_fw_alloc_request() function")
> Cc: stable@vger.kernel.org # v4.17+

oops. my bad.

Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
> ---
>   drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
> index 45928b5b8d97..4fffa6988087 100644
> --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
> +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
> @@ -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;
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] brcmfmac: fix regression in parsing NVRAM for multiple devices
  2018-07-22 21:46 [PATCH] brcmfmac: fix regression in parsing NVRAM for multiple devices Rafał Miłecki
  2018-07-23  6:43 ` Kalle Valo
  2018-07-23 12:01 ` Arend van Spriel
@ 2018-07-25  7:31 ` Kalle Valo
  2 siblings, 0 replies; 4+ messages in thread
From: Kalle Valo @ 2018-07-25  7:31 UTC (permalink / raw)
  To: Rafał Miłecki
  Cc: Arend van Spriel, Franky Lin, Hante Meuleman, Chi-Hsien Lin,
	Wright Feng, Pieter-Paul Giesberts, Chung-Hsien Hsu,
	Aditya Xavier, linux-wireless, brcm80211-dev-list.pdl,
	brcm80211-dev-list, Rafał Miłecki

Rafał Miłecki wrote:

> From: Rafał Miłecki <rafal@milecki.pl>
> 
> 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.
> 
> Reported-by: Aditya Xavier <adityaxavier@gmail.com>
> Fixes: 2baa3aaee27f ("brcmfmac: introduce brcmf_fw_alloc_request() function")
> Cc: stable@vger.kernel.org # v4.17+
> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
> Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>

Patch applied to wireless-drivers.git, thanks.

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

-- 
https://patchwork.kernel.org/patch/10539435/

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-07-25  8:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-22 21:46 [PATCH] brcmfmac: fix regression in parsing NVRAM for multiple devices Rafał Miłecki
2018-07-23  6:43 ` Kalle Valo
2018-07-23 12:01 ` Arend van Spriel
2018-07-25  7:31 ` Kalle Valo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.