307-ath10k-Delay-device-access-after-cold-reset.patch 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. From: Vasanthakumar Thiagarajan <[email protected]>
  2. Date: Fri, 3 Jul 2015 11:45:42 +0530
  3. Subject: [PATCH] ath10k: Delay device access after cold reset
  4. It is observed that during cold reset pcie access right
  5. after a write operation to SOC_GLOBAL_RESET_ADDRESS causes
  6. Data Bus Error and system hard lockup. The reason
  7. for bus error is that pcie needs some time to get
  8. back to stable state for any transaction during cold reset. Add
  9. delay of 20 msecs after write of SOC_GLOBAL_RESET_ADDRESS
  10. to fix this issue.
  11. Signed-off-by: Vasanthakumar Thiagarajan <[email protected]>
  12. ---
  13. --- a/drivers/net/wireless/ath/ath10k/pci.c
  14. +++ b/drivers/net/wireless/ath/ath10k/pci.c
  15. @@ -2602,7 +2602,6 @@ static int ath10k_pci_wait_for_target_in
  16. static int ath10k_pci_cold_reset(struct ath10k *ar)
  17. {
  18. - int i;
  19. u32 val;
  20. ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot cold reset\n");
  21. @@ -2618,23 +2617,18 @@ static int ath10k_pci_cold_reset(struct
  22. val |= 1;
  23. ath10k_pci_reg_write32(ar, SOC_GLOBAL_RESET_ADDRESS, val);
  24. - for (i = 0; i < ATH_PCI_RESET_WAIT_MAX; i++) {
  25. - if (ath10k_pci_reg_read32(ar, RTC_STATE_ADDRESS) &
  26. - RTC_STATE_COLD_RESET_MASK)
  27. - break;
  28. - msleep(1);
  29. - }
  30. + /* After writing into SOC_GLOBAL_RESET to put device into
  31. + * reset and pulling out of reset pcie may not be stable
  32. + * for any immediate pcie register access and cause bus error,
  33. + * add delay before any pcie access request to fix this issue.
  34. + */
  35. + msleep(20);
  36. /* Pull Target, including PCIe, out of RESET. */
  37. val &= ~1;
  38. ath10k_pci_reg_write32(ar, SOC_GLOBAL_RESET_ADDRESS, val);
  39. - for (i = 0; i < ATH_PCI_RESET_WAIT_MAX; i++) {
  40. - if (!(ath10k_pci_reg_read32(ar, RTC_STATE_ADDRESS) &
  41. - RTC_STATE_COLD_RESET_MASK))
  42. - break;
  43. - msleep(1);
  44. - }
  45. + msleep(20);
  46. ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot cold reset complete\n");