346-v5.2-brcmfmac-send-mailbox-interrupt-twice-for-specific-h.patch 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. From 9ef77fbedad9ea8895cd5d7fb7aee16071f527dc Mon Sep 17 00:00:00 2001
  2. From: Wright Feng <Wright.Feng@cypress.com>
  3. Date: Fri, 26 Apr 2019 03:12:32 +0000
  4. Subject: [PATCH] brcmfmac: send mailbox interrupt twice for specific hardware
  5. device
  6. For PCIE wireless device with core revision less than 14, device may miss
  7. PCIE to System Backplane Interrupt via PCIEtoSBMailbox. So add sending
  8. mail box interrupt twice as a hardware workaround.
  9. Signed-off-by: Wright Feng <wright.feng@cypress.com>
  10. Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
  11. ---
  12. drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c | 7 ++++++-
  13. 1 file changed, 6 insertions(+), 1 deletion(-)
  14. --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
  15. +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
  16. @@ -671,6 +671,7 @@ static int
  17. brcmf_pcie_send_mb_data(struct brcmf_pciedev_info *devinfo, u32 htod_mb_data)
  18. {
  19. struct brcmf_pcie_shared_info *shared;
  20. + struct brcmf_core *core;
  21. u32 addr;
  22. u32 cur_htod_mb_data;
  23. u32 i;
  24. @@ -694,7 +695,11 @@ brcmf_pcie_send_mb_data(struct brcmf_pci
  25. brcmf_pcie_write_tcm32(devinfo, addr, htod_mb_data);
  26. pci_write_config_dword(devinfo->pdev, BRCMF_PCIE_REG_SBMBX, 1);
  27. - pci_write_config_dword(devinfo->pdev, BRCMF_PCIE_REG_SBMBX, 1);
  28. +
  29. + /* Send mailbox interrupt twice as a hardware workaround */
  30. + core = brcmf_chip_get_core(devinfo->ci, BCMA_CORE_PCIE2);
  31. + if (core->rev <= 13)
  32. + pci_write_config_dword(devinfo->pdev, BRCMF_PCIE_REG_SBMBX, 1);
  33. return 0;
  34. }