2
0

305-ath9k-make-DMA-stop-related-messages-debug-only.patch 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. From: Felix Fietkau <[email protected]>
  2. Date: Thu, 2 Jul 2015 13:35:05 +0200
  3. Subject: [PATCH] ath9k: make DMA stop related messages debug-only
  4. A long time ago, ath9k had issues during reset where the DMA engine
  5. would stay active and could potentially corrupt memory.
  6. To debug those issues, the driver would print warnings whenever they
  7. occur.
  8. Nowadays, these issues are gone and the primary cause of these messages
  9. is if the MAC is stuck during reset or busy processing a long
  10. transmission. This is fairly harmless, yet these messages continue to
  11. worry users.
  12. To reduce the number of bogus bug reports, turn these messages into
  13. debug messages and count their occurence in the "reset" debugfs file.
  14. Signed-off-by: Felix Fietkau <[email protected]>
  15. ---
  16. --- a/drivers/net/wireless/ath/ath9k/debug.c
  17. +++ b/drivers/net/wireless/ath/ath9k/debug.c
  18. @@ -765,6 +765,8 @@ static int read_file_reset(struct seq_fi
  19. [RESET_TYPE_BEACON_STUCK] = "Stuck Beacon",
  20. [RESET_TYPE_MCI] = "MCI Reset",
  21. [RESET_TYPE_CALIBRATION] = "Calibration error",
  22. + [RESET_TX_DMA_ERROR] = "Tx DMA stop error",
  23. + [RESET_RX_DMA_ERROR] = "Rx DMA stop error",
  24. };
  25. int i;
  26. --- a/drivers/net/wireless/ath/ath9k/debug.h
  27. +++ b/drivers/net/wireless/ath/ath9k/debug.h
  28. @@ -50,6 +50,8 @@ enum ath_reset_type {
  29. RESET_TYPE_BEACON_STUCK,
  30. RESET_TYPE_MCI,
  31. RESET_TYPE_CALIBRATION,
  32. + RESET_TX_DMA_ERROR,
  33. + RESET_RX_DMA_ERROR,
  34. __RESET_TYPE_MAX
  35. };
  36. --- a/drivers/net/wireless/ath/ath9k/recv.c
  37. +++ b/drivers/net/wireless/ath/ath9k/recv.c
  38. @@ -491,10 +491,9 @@ bool ath_stoprecv(struct ath_softc *sc)
  39. if (!(ah->ah_flags & AH_UNPLUGGED) &&
  40. unlikely(!stopped)) {
  41. - ath_err(ath9k_hw_common(sc->sc_ah),
  42. - "Could not stop RX, we could be "
  43. - "confusing the DMA engine when we start RX up\n");
  44. - ATH_DBG_WARN_ON_ONCE(!stopped);
  45. + ath_dbg(ath9k_hw_common(sc->sc_ah), RESET,
  46. + "Failed to stop Rx DMA\n");
  47. + RESET_STAT_INC(sc, RESET_RX_DMA_ERROR);
  48. }
  49. return stopped && !reset;
  50. }
  51. --- a/drivers/net/wireless/ath/ath9k/xmit.c
  52. +++ b/drivers/net/wireless/ath/ath9k/xmit.c
  53. @@ -1883,8 +1883,11 @@ bool ath_drain_all_txq(struct ath_softc
  54. npend |= BIT(i);
  55. }
  56. - if (npend)
  57. - ath_err(common, "Failed to stop TX DMA, queues=0x%03x!\n", npend);
  58. + if (npend) {
  59. + RESET_STAT_INC(sc, RESET_TX_DMA_ERROR);
  60. + ath_dbg(common, RESET,
  61. + "Failed to stop TX DMA, queues=0x%03x!\n", npend);
  62. + }
  63. for (i = 0; i < ATH9K_NUM_TX_QUEUES; i++) {
  64. if (!ATH_TXQ_SETUP(sc, i))