-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ath9k: add workaround for AR9331 USB host controller hang with USB1.1…
… devices When wifi radio is reset, some bits in (undocumented) USB registers may flip. Patch adds setting them after radio reset (channel change, up/down). With this patch stability of USB1.1 full-speed devices, connected directly to AR9331 host port (no USB2.0 hub) is improved.
- Loading branch information
Showing
1 changed file
with
60 additions
and
0 deletions.
There are no files selected for viewing
60 changes: 60 additions & 0 deletions
60
package/mac80211/patches/566-ath9k_usb_hang_workaround.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,60 @@ | |||
--- a/drivers/net/wireless/ath/ath9k/hw.c | |||
+++ b/drivers/net/wireless/ath/ath9k/hw.c | |||
@@ -36,6 +36,16 @@ MODULE_DESCRIPTION("Support for Atheros | |||
MODULE_SUPPORTED_DEVICE("Atheros 802.11n WLAN cards"); | |||
MODULE_LICENSE("Dual BSD/GPL"); | |||
|
|||
+#define WAR_USB_DISABLE_PLL_LOCK_DETECT(_ah) \ | |||
+do { \ | |||
+ if (AR_SREV_9330(_ah) || AR_SREV_9340(_ah)) { \ | |||
+ volatile u_int32_t *usb_ctrl_r1 = (u_int32_t *) 0xb8116c84; \ | |||
+ volatile u_int32_t *usb_ctrl_r2 = (u_int32_t *) 0xb8116c88; \ | |||
+ *usb_ctrl_r1 = (*usb_ctrl_r1 & 0xffefffff); \ | |||
+ *usb_ctrl_r2 = (*usb_ctrl_r2 & 0xfc1fffff) | (1 << 21) | (3 << 22); \ | |||
+ } \ | |||
+} while (0) | |||
+ | |||
static int __init ath9k_init(void) | |||
{ | |||
return 0; | |||
@@ -1388,6 +1398,8 @@ static bool ath9k_hw_set_reset(struct at | |||
if (AR_SREV_9100(ah)) | |||
udelay(50); | |||
|
|||
+ WAR_USB_DISABLE_PLL_LOCK_DETECT(ah); | |||
+ | |||
return true; | |||
} | |||
|
|||
@@ -1488,6 +1500,8 @@ static bool ath9k_hw_chip_reset(struct a | |||
ar9003_hw_internal_regulator_apply(ah); | |||
ath9k_hw_init_pll(ah, chan); | |||
ath9k_hw_set_rfmode(ah, chan); | |||
+ | |||
+ WAR_USB_DISABLE_PLL_LOCK_DETECT(ah); | |||
|
|||
return true; | |||
} | |||
@@ -1741,9 +1755,12 @@ static int ath9k_hw_do_fastcc(struct ath | |||
|
|||
if (AR_SREV_9271(ah)) | |||
ar9002_hw_load_ani_reg(ah, chan); | |||
- | |||
+ | |||
+ WAR_USB_DISABLE_PLL_LOCK_DETECT(ah); | |||
+ | |||
return 0; | |||
fail: | |||
+ WAR_USB_DISABLE_PLL_LOCK_DETECT(ah); | |||
return -EINVAL; | |||
} | |||
|
|||
@@ -2043,6 +2060,8 @@ int ath9k_hw_reset(struct ath_hw *ah, st | |||
if (AR_SREV_9565(ah) && ah->shared_chain_lnadiv) | |||
REG_SET_BIT(ah, AR_BTCOEX_WL_LNADIV, AR_BTCOEX_WL_LNADIV_FORCE_ON); | |||
|
|||
+ WAR_USB_DISABLE_PLL_LOCK_DETECT(ah); | |||
+ | |||
return 0; | |||
} | |||
EXPORT_SYMBOL(ath9k_hw_reset); |