2019-04-25 08:33:40

by Wright Feng

[permalink] [raw]
Subject: [PATCH v2] brcmfmac: send mailbox interrupt twice for specific hardware device

For PCIE wireless device with core revision less than 14, device may miss
PCIE to System Backplane Interrupt via PCIEtoSBMailbox. So add sending
mail box interrupt twice as a hardware workaround.

Signed-off-by: Wright Feng <[email protected]>
---
drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
index fd3968f..66ee92b 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
@@ -698,7 +698,11 @@ brcmf_pcie_send_mb_data(struct brcmf_pciedev_info *devinfo, u32 htod_mb_data)

brcmf_pcie_write_tcm32(devinfo, addr, htod_mb_data);
pci_write_config_dword(devinfo->pdev, BRCMF_PCIE_REG_SBMBX, 1);
- pci_write_config_dword(devinfo->pdev, BRCMF_PCIE_REG_SBMBX, 1);
+
+ /* Send mailbox interrupt twice as a hardware workaround */
+ core = brcmf_chip_get_core(devinfo->ci, BCMA_CORE_PCIE2);
+ if (core->rev <= 13)
+ pci_write_config_dword(devinfo->pdev, BRCMF_PCIE_REG_SBMBX, 1);

return 0;
}
--
2.1.0


2019-04-25 08:42:30

by Arend Van Spriel

[permalink] [raw]
Subject: Re: [PATCH v2] brcmfmac: send mailbox interrupt twice for specific hardware device

On 4/25/2019 9:05 AM, Wright Feng wrote:
> For PCIE wireless device with core revision less than 14, device may miss
> PCIE to System Backplane Interrupt via PCIEtoSBMailbox. So add sending
> mail box interrupt twice as a hardware workaround.

Reviewed-by: Arend van Spriel <[email protected]>
> Signed-off-by: Wright Feng <[email protected]>
> ---
> drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)

2019-04-25 17:00:46

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH v2] brcmfmac: send mailbox interrupt twice for specific hardware device

Wright Feng <[email protected]> wrote:

> For PCIE wireless device with core revision less than 14, device may miss
> PCIE to System Backplane Interrupt via PCIEtoSBMailbox. So add sending
> mail box interrupt twice as a hardware workaround.
>
> Signed-off-by: Wright Feng <[email protected]>
> Reviewed-by: Arend van Spriel <[email protected]>

Failed to compile:

drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c: In function 'brcmf_pcie_send_mb_data':
drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c:703:2: error: 'core' undeclared (first use in this function); did you mean 'cred'?
core = brcmf_chip_get_core(devinfo->ci, BCMA_CORE_PCIE2);
^~~~
cred
drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c:703:2: note: each undeclared identifier is reported only once for each function it appears in
make[6]: *** [drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.o] Error 1
make[5]: *** [drivers/net/wireless/broadcom/brcm80211/brcmfmac] Error 2
make[4]: *** [drivers/net/wireless/broadcom/brcm80211] Error 2
make[3]: *** [drivers/net/wireless/broadcom] Error 2
make[3]: *** Waiting for unfinished jobs....
make[2]: *** [drivers/net/wireless] Error 2
make[1]: *** [drivers/net] Error 2
make[1]: *** Waiting for unfinished jobs....
make: *** [drivers] Error 2

Patch set to Changes Requested.

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

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