brcmfmac: send mailbox interrupt twice for specific hardware device
authorWright Feng <Wright.Feng@cypress.com>
Thu, 25 Apr 2019 07:05:46 +0000 (07:05 +0000)
committerKalle Valo <kvalo@codeaurora.org>
Thu, 25 Apr 2019 16:59:04 +0000 (19:59 +0300)
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 <wright.feng@cypress.com>
Reviewed-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c

index fd3968fd158e95e6bcc55fb6884b4d26e138f2d2..66ee92bb51789cb1cc57391e21d72c7a4d55136d 100644 (file)
@@ -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;
 }