0026-various-fixups-for-ath5k-fixing-system-freezes.patch 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. From 95945fe79069ee6b7ccce2b14fb9f8b93db33918 Mon Sep 17 00:00:00 2001
  2. From: Phil Sutter <phil@nwl.cc>
  3. Date: Sun, 15 Jun 2014 18:29:27 +0200
  4. Subject: [PATCH] various fixups for ath5k, fixing system freezes
  5. ---
  6. drivers/net/wireless/ath/ath5k/base.c | 3 +++
  7. drivers/net/wireless/ath/ath5k/dma.c | 9 +++++++++
  8. drivers/net/wireless/ath/ath5k/initvals.c | 6 ++++++
  9. drivers/net/wireless/ath/ath5k/phy.c | 4 ++--
  10. drivers/net/wireless/ath/ath5k/reset.c | 2 ++
  11. 5 files changed, 22 insertions(+), 2 deletions(-)
  12. diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
  13. index ef35da8..4b18434 100644
  14. --- a/drivers/net/wireless/ath/ath5k/base.c
  15. +++ b/drivers/net/wireless/ath/ath5k/base.c
  16. @@ -751,6 +751,9 @@ ath5k_txbuf_setup(struct ath5k_hw *ah, struct ath5k_buf *bf,
  17. bf->skbaddr = dma_map_single(ah->dev, skb->data, skb->len,
  18. DMA_TO_DEVICE);
  19. + if (dma_mapping_error(ah->dev, bf->skbaddr))
  20. + return -ENOSPC;
  21. +
  22. ieee80211_get_tx_rates(info->control.vif, (control) ? control->sta : NULL, skb, bf->rates,
  23. ARRAY_SIZE(bf->rates));
  24. diff --git a/drivers/net/wireless/ath/ath5k/dma.c b/drivers/net/wireless/ath/ath5k/dma.c
  25. index e6c52f7..72bf600 100644
  26. --- a/drivers/net/wireless/ath/ath5k/dma.c
  27. +++ b/drivers/net/wireless/ath/ath5k/dma.c
  28. @@ -869,10 +869,19 @@ ath5k_hw_dma_init(struct ath5k_hw *ah)
  29. * guess we can tweak it and see how it goes ;-)
  30. */
  31. if (ah->ah_version != AR5K_AR5210) {
  32. +#if !defined(CONFIG_ATHEROS_AR71XX) && !defined(CONFIG_ATH79)
  33. AR5K_REG_WRITE_BITS(ah, AR5K_TXCFG,
  34. AR5K_TXCFG_SDMAMR, AR5K_DMASIZE_128B);
  35. AR5K_REG_WRITE_BITS(ah, AR5K_RXCFG,
  36. AR5K_RXCFG_SDMAMW, AR5K_DMASIZE_128B);
  37. +#else
  38. + /* WAR for AR71xx PCI bug */
  39. + AR5K_REG_WRITE_BITS(ah, AR5K_TXCFG,
  40. + AR5K_TXCFG_SDMAMR, AR5K_DMASIZE_128B);
  41. + AR5K_REG_WRITE_BITS(ah, AR5K_RXCFG,
  42. + AR5K_RXCFG_SDMAMW, AR5K_DMASIZE_4B);
  43. +#endif
  44. +
  45. }
  46. /* Pre-enable interrupts on 5211/5212*/
  47. diff --git a/drivers/net/wireless/ath/ath5k/initvals.c b/drivers/net/wireless/ath/ath5k/initvals.c
  48. index ee1c2fa..ba84ab5 100644
  49. --- a/drivers/net/wireless/ath/ath5k/initvals.c
  50. +++ b/drivers/net/wireless/ath/ath5k/initvals.c
  51. @@ -62,8 +62,14 @@ static const struct ath5k_ini ar5210_ini[] = {
  52. { AR5K_IMR, 0 },
  53. { AR5K_IER, AR5K_IER_DISABLE },
  54. { AR5K_BSR, 0, AR5K_INI_READ },
  55. +#if !defined(CONFIG_ATHEROS_AR71XX) && !defined(CONFIG_ATH79)
  56. { AR5K_TXCFG, AR5K_DMASIZE_128B },
  57. { AR5K_RXCFG, AR5K_DMASIZE_128B },
  58. +#else
  59. + /* WAR for AR71xx PCI bug */
  60. + { AR5K_TXCFG, AR5K_DMASIZE_128B },
  61. + { AR5K_RXCFG, AR5K_DMASIZE_4B },
  62. +#endif
  63. { AR5K_CFG, AR5K_INIT_CFG },
  64. { AR5K_TOPS, 8 },
  65. { AR5K_RXNOFRM, 8 },
  66. diff --git a/drivers/net/wireless/ath/ath5k/phy.c b/drivers/net/wireless/ath/ath5k/phy.c
  67. index 1a2973b..0fce1c7 100644
  68. --- a/drivers/net/wireless/ath/ath5k/phy.c
  69. +++ b/drivers/net/wireless/ath/ath5k/phy.c
  70. @@ -3709,8 +3709,8 @@ ath5k_hw_txpower(struct ath5k_hw *ah, struct ieee80211_channel *channel,
  71. AR5K_REG_MS(AR5K_TUNE_MAX_TXPOWER, AR5K_TPC_CHIRP),
  72. AR5K_TPC);
  73. } else {
  74. - ath5k_hw_reg_write(ah, AR5K_PHY_TXPOWER_RATE_MAX |
  75. - AR5K_TUNE_MAX_TXPOWER, AR5K_PHY_TXPOWER_RATE_MAX);
  76. + ath5k_hw_reg_write(ah, AR5K_TUNE_MAX_TXPOWER,
  77. + AR5K_PHY_TXPOWER_RATE_MAX);
  78. }
  79. return 0;
  80. diff --git a/drivers/net/wireless/ath/ath5k/reset.c b/drivers/net/wireless/ath/ath5k/reset.c
  81. index a3399c4..66d0ecc 100644
  82. --- a/drivers/net/wireless/ath/ath5k/reset.c
  83. +++ b/drivers/net/wireless/ath/ath5k/reset.c
  84. @@ -1154,6 +1154,7 @@ ath5k_hw_reset(struct ath5k_hw *ah, enum nl80211_iftype op_mode,
  85. tsf_lo = 0;
  86. mode = 0;
  87. +#if 0
  88. /*
  89. * Sanity check for fast flag
  90. * Fast channel change only available
  91. @@ -1161,6 +1162,7 @@ ath5k_hw_reset(struct ath5k_hw *ah, enum nl80211_iftype op_mode,
  92. */
  93. if (fast && (ah->ah_radio != AR5K_RF2413) &&
  94. (ah->ah_radio != AR5K_RF5413))
  95. +#endif
  96. fast = false;
  97. /* Disable sleep clock operation
  98. --
  99. 1.8.5.3