2
0

315-ath9k_hw-check-if-the-chip-failed-to-wake-up.patch 898 B

123456789101112131415161718192021222324252627282930
  1. From: Felix Fietkau <nbd@nbd.name>
  2. Date: Wed, 25 Jan 2017 12:58:17 +0100
  3. Subject: [PATCH] ath9k_hw: check if the chip failed to wake up
  4. In an RFC patch, Sven Eckelmann and Simon Wunderlich reported:
  5. "QCA 802.11n chips (especially AR9330/AR9340) sometimes end up in a
  6. state in which a read of AR_CFG always returns 0xdeadbeef.
  7. This should not happen when when the power_mode of the device is
  8. ATH9K_PM_AWAKE."
  9. Include the check for the default register state in the existing MAC
  10. hang check.
  11. Signed-off-by: Felix Fietkau <nbd@nbd.name>
  12. ---
  13. --- a/drivers/net/wireless/ath/ath9k/hw.c
  14. +++ b/drivers/net/wireless/ath/ath9k/hw.c
  15. @@ -1624,6 +1624,10 @@ bool ath9k_hw_check_alive(struct ath_hw
  16. int count = 50;
  17. u32 reg, last_val;
  18. + /* Check if chip failed to wake up */
  19. + if (REG_READ(ah, AR_CFG) == 0xdeadbeef)
  20. + return false;
  21. +
  22. if (AR_SREV_9300(ah))
  23. return !ath9k_hw_detect_mac_hang(ah);