ath9k: Fix max AMPDU size calculation
PATCH 1/11 ath9k: Fix max AMPDU size calculation
From: Sujith Manoharan <[email protected]>
The maximum A-MPDU size is calculated in ath_tx_aggr_start(), so there is no need to do it in node_attach() too. Also, make sure that the correct size is calculated as described in 8.4.2.58.3.
--- drivers/net/wireless/ath/ath9k/main.c | 6 ------ drivers/net/wireless/ath/ath9k/xmit.c | 9 ++------- 2 files changed, 2 insertions(+), 13 deletions(-)
drivers/net/wireless/ath/ath9k/main.c +0 -6
@@ -427,12 +427,6 @@ static void ath_node_attach(struct ath_softc *sc, struct ieee80211_sta *sta, an->vif = vif;ath_tx_node_init (sc, an); - -if (sta->ht_cap.ht_supported) { - an->maxampdu =1 << (IEEE80211_HT_MAX_AMPDU_FACTOR + - sta->ht_cap.ampdu_factor); - an->mpdudensity =ath9k_parse_mpdudensity (sta->ht_cap.ampdu_density); - } }static void ath_node_detach (struct ath_softc *sc,struct ieee80211_sta *sta)
drivers/net/wireless/ath/ath9k/xmit.c +2 -7
@@ -774,11 +774,6 @@ static u32 ath_lookup_rate(struct ath_softc *sc, struct ath_buf *bf,if (bt_aggr_limit) aggr_limit = bt_aggr_limit; -/* -* h/w can accept aggregates up to 16 bit lengths (65535). -* The IE, however can hold up to 65536, which shows up here -* as zero. Ignore 65536 since we are constrained by hw. -*/ if (tid->an->maxampdu) aggr_limit =min (aggr_limit, tid->an->maxampdu);
@@ -1403,8 +1398,8 @@ int ath_tx_aggr_start(struct ath_softc *sc, struct ieee80211_sta *sta,* has already been added. */ if (sta->ht_cap.ht_supported) { - an->maxampdu =1 << (IEEE80211_HT_MAX_AMPDU_FACTOR + - sta->ht_cap.ampdu_factor); + an->maxampdu = (1 << (IEEE80211_HT_MAX_AMPDU_FACTOR + + sta->ht_cap.ampdu_factor)) -1 ; density =ath9k_parse_mpdudensity (sta->ht_cap.ampdu_density); an->mpdudensity = density; }
Signature · 1 line
1.8.5.2
PATCH 2/11 ath9k: Register supported HW hang checks
From: Sujith Manoharan <[email protected]>
HW hang checks have to be done on a per-chip basis.
--- drivers/net/wireless/ath/ath9k/ar9002_hw.c | 15 +++++++++++++++ drivers/net/wireless/ath/ath9k/ar9003_hw.c | 21 +++++++++++++++++++++ drivers/net/wireless/ath/ath9k/hw-ops.h | 5 +++++ drivers/net/wireless/ath/ath9k/hw.c | 5 +---- drivers/net/wireless/ath/ath9k/hw.h | 22 +++++++++++++++++----- 5 files changed, 59 insertions(+), 9 deletions(-)
drivers/net/wireless/ath/ath9k/ar9002_hw.c +15 -0
@@ -383,6 +383,20 @@ void ar9002_hw_enable_async_fifo(struct ath_hw *ah) } } +static void ar9002_hw_init_hang_checks (struct ath_hw *ah) +{ +if (AR_SREV_9100 (ah) ||AR_SREV_9160 (ah)) { + ah->config.hw_hang_checks |=HW_BB_RIFS_HANG ; + ah->config.hw_hang_checks |=HW_BB_DFS_HANG ; + } + +if (AR_SREV_9280 (ah)) + ah->config.hw_hang_checks |=HW_BB_RX_CLEAR_STUCK_HANG ; + +if (AR_SREV_5416 (ah) ||AR_SREV_9100 (ah) ||AR_SREV_9160 (ah)) + ah->config.hw_hang_checks |=HW_MAC_HANG ; +} +/* Sets up the AR5008/AR9001/AR9002 hardware familiy callbacks */ int ar9002_hw_attach_ops (struct ath_hw *ah) {
@@ -395,6 +409,7 @@ int ar9002_hw_attach_ops(struct ath_hw *ah)return ret; priv_ops->init_mode_gain_regs = ar9002_hw_init_mode_gain_regs; + priv_ops->init_hang_checks = ar9002_hw_init_hang_checks; ops->config_pci_powersave = ar9002_hw_configpcipowersave;
drivers/net/wireless/ath/ath9k/ar9003_hw.c +21 -0
@@ -872,6 +872,26 @@ static void ar9003_hw_configpcipowersave(struct ath_hw *ah, } } +static void ar9003_hw_init_hang_checks (struct ath_hw *ah) +{ +/* +* All chips support detection of BB/MAC hangs. +*/ + ah->config.hw_hang_checks |=HW_BB_WATCHDOG ; + ah->config.hw_hang_checks |=HW_MAC_HANG ; + +/* +* This is not required for AR9580 1.0 +*/ +if (AR_SREV_9300_22 (ah)) + ah->config.hw_hang_checks |=HW_PHYRESTART_CLC_WAR ; + +if (AR_SREV_9330 (ah)) + ah->bb_watchdog_timeout_ms =85 ; +else + ah->bb_watchdog_timeout_ms =25 ; +} +/* Sets up the AR9003 hardware familiy callbacks */ void ar9003_hw_attach_ops (struct ath_hw *ah) {
@@ -880,6 +900,7 @@ void ar9003_hw_attach_ops(struct ath_hw *ah)ar9003_hw_init_mode_regs (ah); priv_ops->init_mode_gain_regs = ar9003_hw_init_mode_gain_regs; + priv_ops->init_hang_checks = ar9003_hw_init_hang_checks; ops->config_pci_powersave = ar9003_hw_configpcipowersave;
drivers/net/wireless/ath/ath9k/hw-ops.h +5 -0
@@ -107,6 +107,11 @@ static inline void ath9k_hw_set_bt_ant_diversity(struct ath_hw *ah, bool enable)/* Private hardware call ops */ +static inline void ath9k_hw_init_hang_checks (struct ath_hw *ah) +{ +ath9k_hw_private_ops (ah)->init_hang_checks (ah); +} +/* PHY ops */ static inline int ath9k_hw_rf_set_freq(struct ath_hw *ah,
drivers/net/wireless/ath/ath9k/hw.c +1 -4
@@ -636,10 +636,7 @@ static int __ath9k_hw_init(struct ath_hw *ah)else ah->tx_trig_level = (AR_FTRIG_512B >>AR_FTRIG_S ); -if (AR_SREV_9330 (ah)) - ah->bb_watchdog_timeout_ms =85 ; -else - ah->bb_watchdog_timeout_ms =25 ; +ath9k_hw_init_hang_checks (ah); common->state =ATH_HW_INITIALIZED ;
drivers/net/wireless/ath/ath9k/hw.h +17 -5
@@ -277,6 +277,21 @@ struct ath9k_hw_capabilities {u8 txs_len; }; +#define AR_NO_SPUR 0x8000 +#define AR_BASE_FREQ_2GHZ 2300 +#define AR_BASE_FREQ_5GHZ 4900 +#define AR_SPUR_FEEQ_BOUND_HT40 19 +#define AR_SPUR_FEEQ_BOUND_HT20 10 + +enum ath9k_hw_hang_checks { +HW_BB_WATCHDOG =BIT (0 ), +HW_PHYRESTART_CLC_WAR =BIT (1 ), +HW_BB_RIFS_HANG =BIT (2 ), +HW_BB_DFS_HANG =BIT (3 ), +HW_BB_RX_CLEAR_STUCK_HANG =BIT (4 ), +HW_MAC_HANG =BIT (5 ), +}; +struct ath9k_ops_config {int dma_beacon_response_time;int sw_beacon_response_time;
@@ -292,13 +307,9 @@ struct ath9k_ops_config {int serialize_regmode;bool rx_intr_mitigation;bool tx_intr_mitigation; -#define AR_NO_SPUR 0x8000 -#define AR_BASE_FREQ_2GHZ 2300 -#define AR_BASE_FREQ_5GHZ 4900 -#define AR_SPUR_FEEQ_BOUND_HT40 19 -#define AR_SPUR_FEEQ_BOUND_HT20 10u8 max_txtrig_level;u16 ani_poll_interval;/* ANI poll interval in ms */ +u16 hw_hang_checks;/* Platform specific config */ u32 aspm_l1_fix;
@@ -573,6 +584,7 @@ struct ath_hw_radar_conf {* register settings through the register initialization. */ struct ath_hw_private_ops { +void (*init_hang_checks)(struct ath_hw *ah);/* Calibration ops */ void (*init_cal_settings)(struct ath_hw *ah);bool (*init_cal)(struct ath_hw *ah,struct ath9k_channel *chan);
Signature · 1 line
1.8.5.2
PATCH 3/11 ath9k: Add HW callbacks for MAC/BB hang checks
In reply to Sujith ManoharanFrom: Sujith Manoharan <[email protected]>
This is required for adding separate hang check
routines for AR9002 and AR9003.
--- drivers/net/wireless/ath/ath9k/ar9003_hw.c | 72 ++++++++++++++++++++++++++++++ drivers/net/wireless/ath/ath9k/hw-ops.h | 10 +++++ drivers/net/wireless/ath/ath9k/hw.c | 70 ----------------------------- drivers/net/wireless/ath/ath9k/hw.h | 3 ++ 4 files changed, 85 insertions(+), 70 deletions(-)
drivers/net/wireless/ath/ath9k/ar9003_hw.c +72 -0
@@ -892,6 +892,77 @@ static void ar9003_hw_init_hang_checks(struct ath_hw *ah) ah->bb_watchdog_timeout_ms =25 ; } +static bool ath9k_hw_check_dcs (u32 dma_dbg,u32 num_dcu_states, +int *hang_state,int *hang_pos) +{ +static u32 dcu_chain_state[] = {5 ,6 ,9 };/* DCU chain stuck states */ +u32 chain_state, dcs_pos, i; + +for (dcs_pos =0 ; dcs_pos < num_dcu_states; dcs_pos++) { + chain_state = (dma_dbg >> (5 * dcs_pos)) &0x1f ; +for (i =0 ; i <3 ; i++) { +if (chain_state == dcu_chain_state[i]) { + *hang_state = chain_state; + *hang_pos = dcs_pos; +return true; + } + } + } +return false; +} + +#define DCU_COMPLETE_STATE 1 +#define DCU_COMPLETE_STATE_MASK 0x3 +#define NUM_STATUS_READS 50 + +static bool ar9003_hw_detect_mac_hang (struct ath_hw *ah) +{ +u32 chain_state, comp_state, dcs_reg =AR_DMADBG_4 ; +u32 i, hang_pos, hang_state, num_state =6 ; + + comp_state =REG_READ (ah,AR_DMADBG_6 ); + +if ((comp_state &DCU_COMPLETE_STATE_MASK ) !=DCU_COMPLETE_STATE ) { +ath_dbg (ath9k_hw_common (ah),RESET , +"MAC Hang signature not found at DCU complete\n" ); +return false; + } + + chain_state =REG_READ (ah, dcs_reg); +if (ath9k_hw_check_dcs (chain_state, num_state, &hang_state, &hang_pos)) + goto hang_check_iter; + + dcs_reg =AR_DMADBG_5 ; + num_state =4 ; + chain_state =REG_READ (ah, dcs_reg); +if (ath9k_hw_check_dcs (chain_state, num_state, &hang_state, &hang_pos)) + goto hang_check_iter; + +ath_dbg (ath9k_hw_common (ah),RESET , +"MAC Hang signature 1 not found\n" ); +return false; + +hang_check_iter: +ath_dbg (ath9k_hw_common (ah),RESET , +"DCU registers: chain %08x complete %08x Hang: state %d pos %d\n" , + chain_state, comp_state, hang_state, hang_pos); + +for (i =0 ; i <NUM_STATUS_READS ; i++) { + chain_state =REG_READ (ah, dcs_reg); + chain_state = (chain_state >> (5 * hang_pos)) &0x1f ; + comp_state =REG_READ (ah,AR_DMADBG_6 ); + +if (((comp_state &DCU_COMPLETE_STATE_MASK ) != +DCU_COMPLETE_STATE ) || + (chain_state != hang_state)) +return false; + } + +ath_dbg (ath9k_hw_common (ah),RESET ,"MAC Hang signature 1 found\n" ); + +return true; +} +/* Sets up the AR9003 hardware familiy callbacks */ void ar9003_hw_attach_ops (struct ath_hw *ah) {
@@ -901,6 +972,7 @@ void ar9003_hw_attach_ops(struct ath_hw *ah)ar9003_hw_init_mode_regs (ah); priv_ops->init_mode_gain_regs = ar9003_hw_init_mode_gain_regs; priv_ops->init_hang_checks = ar9003_hw_init_hang_checks; + priv_ops->detect_mac_hang = ar9003_hw_detect_mac_hang; ops->config_pci_powersave = ar9003_hw_configpcipowersave;
drivers/net/wireless/ath/ath9k/hw-ops.h +10 -0
@@ -112,6 +112,16 @@ static inline void ath9k_hw_init_hang_checks(struct ath_hw *ah)ath9k_hw_private_ops (ah)->init_hang_checks (ah); } +static inline bool ath9k_hw_detect_mac_hang (struct ath_hw *ah) +{ +return ath9k_hw_private_ops (ah)->detect_mac_hang (ah); +} + +static inline bool ath9k_hw_detect_bb_hang (struct ath_hw *ah) +{ +return ath9k_hw_private_ops (ah)->detect_bb_hang (ah); +} +/* PHY ops */ static inline int ath9k_hw_rf_set_freq(struct ath_hw *ah,
drivers/net/wireless/ath/ath9k/hw.c +0 -70
76 lines not on this page · raw message
drivers/net/wireless/ath/ath9k/hw.h +3 -0
@@ -585,6 +585,9 @@ struct ath_hw_radar_conf {*/ struct ath_hw_private_ops {void (*init_hang_checks)(struct ath_hw *ah); +bool (*detect_mac_hang)(struct ath_hw *ah); +bool (*detect_bb_hang)(struct ath_hw *ah); +/* Calibration ops */ void (*init_cal_settings)(struct ath_hw *ah);bool (*init_cal)(struct ath_hw *ah,struct ath9k_channel *chan);
Signature · 1 line
1.8.5.2
PATCH 4/11 ath9k: Fix MAC HW hang check for AR9003
In reply to Sujith ManoharanFrom: Sujith Manoharan <[email protected]>
The current method of identifying MAC hangs is convoluted and also, the signatures are wrong and don't apply to all the chips in the AR9003 family. Fix this by cleaning up the code and checking for the correct hang signatures.
--- drivers/net/wireless/ath/ath9k/ar9003_hw.c | 130 +++++++++++++++++------------ 1 file changed, 75 insertions(+), 55 deletions(-)
drivers/net/wireless/ath/ath9k/ar9003_hw.c +75 -55
@@ -892,75 +892,95 @@ static void ar9003_hw_init_hang_checks(struct ath_hw *ah) ah->bb_watchdog_timeout_ms =25 ; } -static bool ath9k_hw_check_dcs (u32 dma_dbg,u32 num_dcu_states, -int *hang_state,int *hang_pos) -{ -static u32 dcu_chain_state[] = {5 ,6 ,9 };/* DCU chain stuck states */ -u32 chain_state, dcs_pos, i; - -for (dcs_pos =0 ; dcs_pos < num_dcu_states; dcs_pos++) { - chain_state = (dma_dbg >> (5 * dcs_pos)) &0x1f ; -for (i =0 ; i <3 ; i++) { -if (chain_state == dcu_chain_state[i]) { - *hang_state = chain_state; - *hang_pos = dcs_pos; -return true; - } - } - } -return false; -} +/* +* MAC HW hang check +* ================= +* +* Signature: dcu_chain_state is 0x6 and dcu_complete_state is 0x1. +* +* The state of each DCU chain (mapped to TX queues) is available from these +* DMA debug registers: +* +* Chain 0 state : Bits 4:0 of AR_DMADBG_4 +* Chain 1 state : Bits 9:5 of AR_DMADBG_4 +* Chain 2 state : Bits 14:10 of AR_DMADBG_4 +* Chain 3 state : Bits 19:15 of AR_DMADBG_4 +* Chain 4 state : Bits 24:20 of AR_DMADBG_4 +* Chain 5 state : Bits 29:25 of AR_DMADBG_4 +* Chain 6 state : Bits 4:0 of AR_DMADBG_5 +* Chain 7 state : Bits 9:5 of AR_DMADBG_5 +* Chain 8 state : Bits 14:10 of AR_DMADBG_5 +* Chain 9 state : Bits 19:15 of AR_DMADBG_5 +* +* The DCU chain state "0x6" means "WAIT_FRDONE" - wait for TX frame to be done. +*/ -#define DCU_COMPLETE_STATE 1 -#define DCU_COMPLETE_STATE_MASK 0x3 -#define NUM_STATUS_READS 50 +#define NUM_STATUS_READS 50 -static bool ar9003_hw_detect_mac_hang (struct ath_hw *ah) +static bool ath9k_hw_verify_hang (struct ath_hw *ah,unsigned int queue) { -u32 chain_state, comp_state, dcs_reg =AR_DMADBG_4 ; -u32 i, hang_pos, hang_state, num_state =6 ; +u32 dma_dbg_chain, dma_dbg_complete; +u8 dcu_chain_state, dcu_complete_state; +int i; - comp_state =REG_READ (ah,AR_DMADBG_6 ); +for (i =0 ; i <NUM_STATUS_READS ; i++) { +if (queue <6 ) + dma_dbg_chain =REG_READ (ah,AR_DMADBG_4 ); +else + dma_dbg_chain =REG_READ (ah,AR_DMADBG_5 ); -if ((comp_state &DCU_COMPLETE_STATE_MASK ) !=DCU_COMPLETE_STATE ) { -ath_dbg (ath9k_hw_common (ah),RESET , -"MAC Hang signature not found at DCU complete\n" ); -return false; - } + dma_dbg_complete =REG_READ (ah,AR_DMADBG_6 ); - chain_state =REG_READ (ah, dcs_reg); -if (ath9k_hw_check_dcs (chain_state, num_state, &hang_state, &hang_pos)) - goto hang_check_iter; + dcu_chain_state = (dma_dbg_chain >> (5 * queue)) &0x1f ; + dcu_complete_state = dma_dbg_complete &0x3 ; - dcs_reg =AR_DMADBG_5 ; - num_state =4 ; - chain_state =REG_READ (ah, dcs_reg); -if (ath9k_hw_check_dcs (chain_state, num_state, &hang_state, &hang_pos)) - goto hang_check_iter; +if ((dcu_chain_state !=0x6 ) || (dcu_complete_state !=0x1 )) +return false; + }ath_dbg (ath9k_hw_common (ah),RESET , -"MAC Hang signature 1 not found\n" ); -return false; +"MAC Hang signature found for queue: %d\n" , queue); -hang_check_iter: -ath_dbg (ath9k_hw_common (ah),RESET , -"DCU registers: chain %08x complete %08x Hang: state %d pos %d\n" , - chain_state, comp_state, hang_state, hang_pos); +return true; +} -for (i =0 ; i <NUM_STATUS_READS ; i++) { - chain_state =REG_READ (ah, dcs_reg); - chain_state = (chain_state >> (5 * hang_pos)) &0x1f ; - comp_state =REG_READ (ah,AR_DMADBG_6 ); +static bool ar9003_hw_detect_mac_hang (struct ath_hw *ah) +{ +u32 dma_dbg_4, dma_dbg_5, dma_dbg_6, chk_dbg; +u8 dcu_chain_state, dcu_complete_state; +bool dcu_wait_frdone = false; +unsigned long chk_dcu =0 ; +unsigned int i =0 ; + + dma_dbg_4 =REG_READ (ah,AR_DMADBG_4 ); + dma_dbg_5 =REG_READ (ah,AR_DMADBG_5 ); + dma_dbg_6 =REG_READ (ah,AR_DMADBG_6 ); + + dcu_complete_state = dma_dbg_6 &0x3 ; +if (dcu_complete_state !=0x1 ) + goto exit; + +for (i =0 ; i <ATH9K_NUM_TX_QUEUES ; i++) { +if (i <6 ) + chk_dbg = dma_dbg_4; +else + chk_dbg = dma_dbg_5; -if (((comp_state &DCU_COMPLETE_STATE_MASK ) != -DCU_COMPLETE_STATE ) || - (chain_state != hang_state)) -return false; + dcu_chain_state = (chk_dbg >> (5 * i)) &0x1f ; +if (dcu_chain_state ==0x6 ) { + dcu_wait_frdone = true; + chk_dcu |=BIT (i); + } } -ath_dbg (ath9k_hw_common (ah),RESET ,"MAC Hang signature 1 found\n" ); - -return true; +if ((dcu_complete_state ==0x1 ) && dcu_wait_frdone) { +for_each_set_bit (i, &chk_dcu,ATH9K_NUM_TX_QUEUES ) { +if (ath9k_hw_verify_hang (ah, i)) +return true; + } + } +exit: +return false; }/* Sets up the AR9003 hardware familiy callbacks */
Signature · 1 line
1.8.5.2
PATCH 5/11 ath9k: Fix PHY restart workaround
In reply to Sujith ManoharanFrom: Sujith Manoharan <[email protected]>
The PHY restart workaround that handles baseband hangs for packets with unsupported rates is required only for a HW bug in AR9300 v2.2. All the subsequent chips in the AR9003 family do not require this driver fix since it has been addressed in the HW.
Since the value of the AR_PHY_RESTART register is written with the default initvals, make sure that PHY restart is always disabled once this particular BB hang signaure has been encountered.
--- drivers/net/wireless/ath/ath9k/ar9003_phy.c | 17 ++++++++--------- drivers/net/wireless/ath/ath9k/hw.c | 5 +++-- 2 files changed, 11 insertions(+), 11 deletions(-)
drivers/net/wireless/ath/ath9k/ar9003_phy.c +8 -9
@@ -1930,6 +1930,7 @@ EXPORT_SYMBOL(ar9003_hw_bb_watchdog_dbg_info);void ar9003_hw_disable_phy_restart (struct ath_hw *ah) { +u8 result;u32 val;/* While receiving unsupported rate frame rx state machine
@@ -1937,15 +1938,13 @@ void ar9003_hw_disable_phy_restart(struct ath_hw *ah)* state, BB would go hang. If RXSM is in 0xb state after * first bb panic, ensure to disable the phy_restart. */ -if (!((MS (ah->bb_watchdog_last_status, -AR_PHY_WATCHDOG_RX_OFDM_SM ) ==0xb ) || - ah->bb_hang_rx_ofdm)) -return ; - - ah->bb_hang_rx_ofdm = true; - val =REG_READ (ah,AR_PHY_RESTART ); - val &= ~AR_PHY_RESTART_ENA ; + result =MS (ah->bb_watchdog_last_status,AR_PHY_WATCHDOG_RX_OFDM_SM ); -REG_WRITE (ah,AR_PHY_RESTART , val); +if ((result ==0xb ) || ah->bb_hang_rx_ofdm) { + ah->bb_hang_rx_ofdm = true; + val =REG_READ (ah,AR_PHY_RESTART ); + val &= ~AR_PHY_RESTART_ENA ; +REG_WRITE (ah,AR_PHY_RESTART , val); + } }EXPORT_SYMBOL (ar9003_hw_disable_phy_restart);
drivers/net/wireless/ath/ath9k/hw.c +3 -2
@@ -1935,10 +1935,11 @@ int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan,ath9k_hw_loadnf (ah, chan);ath9k_hw_start_nfcal (ah, true); -if (AR_SREV_9300_20_OR_LATER (ah)) { +if (AR_SREV_9300_20_OR_LATER (ah))ar9003_hw_bb_watchdog_config (ah); + +if (ah->config.hw_hang_checks &HW_PHYRESTART_CLC_WAR )ar9003_hw_disable_phy_restart (ah); - }ath9k_hw_apply_gpio_override (ah);
Signature · 1 line
1.8.5.2
PATCH 6/11 ath9k: Fix baseband watchdog interrupts
In reply to Sujith ManoharanFrom: Sujith Manoharan <[email protected]>
Program the required baseband watchdog interrupt mask to ensure that the correct watchdog interrupts are raised when the BB is hung for some reason.
Also, use the capability HW_BB_WATCHDOG instead of relying on other flags.
--- drivers/net/wireless/ath/ath9k/mac.c | 24 +++++++++++++++++++++--- drivers/net/wireless/ath/ath9k/main.c | 8 +++++--- drivers/net/wireless/ath/ath9k/reg.h | 1 + 3 files changed, 27 insertions(+), 6 deletions(-)
drivers/net/wireless/ath/ath9k/mac.c +21 -3
@@ -922,11 +922,29 @@ void ath9k_hw_set_interrupts(struct ath_hw *ah) mask2 |=AR_IMR_S2_CST ; } +if (ah->config.hw_hang_checks &HW_BB_WATCHDOG ) { +if (ints &ATH9K_INT_BB_WATCHDOG ) { + mask |=AR_IMR_BCNMISC ; + mask2 |=AR_IMR_S2_BB_WATCHDOG ; + } + } +ath_dbg (common,INTERRUPT ,"new IMR 0x%x\n" , mask);REG_WRITE (ah,AR_IMR , mask); - ah->imrs2_reg &= ~(AR_IMR_S2_TIM |AR_IMR_S2_DTIM |AR_IMR_S2_DTIMSYNC | -AR_IMR_S2_CABEND |AR_IMR_S2_CABTO | -AR_IMR_S2_TSFOOR |AR_IMR_S2_GTT |AR_IMR_S2_CST ); + ah->imrs2_reg &= ~(AR_IMR_S2_TIM | +AR_IMR_S2_DTIM | +AR_IMR_S2_DTIMSYNC | +AR_IMR_S2_CABEND | +AR_IMR_S2_CABTO | +AR_IMR_S2_TSFOOR | +AR_IMR_S2_GTT | +AR_IMR_S2_CST ); + +if (ah->config.hw_hang_checks &HW_BB_WATCHDOG ) { +if (ints &ATH9K_INT_BB_WATCHDOG ) + ah->imrs2_reg &= ~AR_IMR_S2_BB_WATCHDOG ; + } + ah->imrs2_reg |= mask2;REG_WRITE (ah,AR_IMR_S2 , ah->imrs2_reg);
drivers/net/wireless/ath/ath9k/main.c +5 -3
@@ -587,7 +587,7 @@ irqreturn_t ath_isr(int irq, void *dev) !(ah->caps.hw_caps & ATH9K_HW_CAP_EDMA))) goto chip_reset; -if ((ah->caps.hw_caps &ATH9K_HW_CAP_EDMA ) && +if ((ah->config.hw_hang_checks &HW_BB_WATCHDOG ) && (status &ATH9K_INT_BB_WATCHDOG )) {spin_lock (&common->cc_lock);
@@ -726,11 +726,13 @@ static int ath9k_start(struct ieee80211_hw *hw)if (ah->caps.hw_caps &ATH9K_HW_CAP_EDMA ) ah->imask |=ATH9K_INT_RXHP | -ATH9K_INT_RXLP | -ATH9K_INT_BB_WATCHDOG ; +ATH9K_INT_RXLP ;else ah->imask |=ATH9K_INT_RX ; +if (ah->config.hw_hang_checks &HW_BB_WATCHDOG ) + ah->imask |=ATH9K_INT_BB_WATCHDOG ; + ah->imask |=ATH9K_INT_GTT ;if (ah->caps.hw_caps &ATH9K_HW_CAP_HT )
drivers/net/wireless/ath/ath9k/reg.h +1 -0
@@ -304,6 +304,7 @@#define AR_IMR_S2 0x00ac#define AR_IMR_S2_QCU_TXURN 0x000003FF#define AR_IMR_S2_QCU_TXURN_S 0 +#define AR_IMR_S2_BB_WATCHDOG 0x00010000#define AR_IMR_S2_CST 0x00400000#define AR_IMR_S2_GTT 0x00800000#define AR_IMR_S2_TIM 0x01000000
Signature · 1 line
1.8.5.2
PATCH 7/11 ath9k: Identify baseband watchdog signatures
In reply to Sujith ManoharanFrom: Sujith Manoharan <[email protected]>
A full HW reset is not required for all baseband watchdog signatures. Some BB watchdog updates are benign and can be discarded, some require re-programming of certain registers and others require a chip reset.
This patch adds a routine to identify such signatures.
--- drivers/net/wireless/ath/ath9k/ar9003_phy.c | 62 +++++++++++++++++++++++++++++ drivers/net/wireless/ath/ath9k/ar9003_phy.h | 2 + drivers/net/wireless/ath/ath9k/hw.h | 1 + 3 files changed, 65 insertions(+)
drivers/net/wireless/ath/ath9k/ar9003_phy.c +62 -0
@@ -1814,6 +1814,68 @@ void ar9003_hw_attach_phy_ops(struct ath_hw *ah)memcpy (ah->nf_regs, ar9300_cca_regs,sizeof (ah->nf_regs)); } +/* +* Baseband Watchdog signatures: +* +* 0x04000539: BB hang when operating in HT40 DFS Channel. +* Full chip reset is not required, but a recovery +* mechanism is needed. +* +* 0x1300000a: Related to CAC deafness. +* Chip reset is not required. +* +* 0x0400000a: Related to CAC deafness. +* Full chip reset is required. +* +* 0x04000b09: RX state machine gets into an illegal state +* when a packet with unsupported rate is received. +* Full chip reset is required and PHY_RESTART has +* to be disabled. +* +* 0x04000409: Packet stuck on receive. +* Full chip reset is required for all chips except AR9340. +*/ + +/* +* ar9003_hw_bb_watchdog_check(): Returns true if a chip reset is required. +*/ +bool ar9003_hw_bb_watchdog_check (struct ath_hw *ah) +{ +u32 val; + +switch (ah->bb_watchdog_last_status) { +case 0x04000539 : + val =REG_READ (ah,AR_PHY_RADAR_0 ); + val &= (~AR_PHY_RADAR_0_FIRPWR ); + val |=SM (0x7f ,AR_PHY_RADAR_0_FIRPWR ); +REG_WRITE (ah,AR_PHY_RADAR_0 , val); +udelay (1 ); + val =REG_READ (ah,AR_PHY_RADAR_0 ); + val &= ~AR_PHY_RADAR_0_FIRPWR ; + val |=SM (AR9300_DFS_FIRPWR ,AR_PHY_RADAR_0_FIRPWR ); +REG_WRITE (ah,AR_PHY_RADAR_0 , val); + +return false; +case 0x1300000a : +return false; +case 0x0400000a : +case 0x04000b09 : +return true; +case 0x04000409 : +if (AR_SREV_9340 (ah)) +return false; +else +return true; +default : +/* +* For any other unknown signatures, do a +* full chip reset. +*/ +return true; + } +} +EXPORT_SYMBOL (ar9003_hw_bb_watchdog_check); +void ar9003_hw_bb_watchdog_config (struct ath_hw *ah) {struct ath_common *common =ath9k_hw_common (ah);
drivers/net/wireless/ath/ath9k/ar9003_phy.h +2 -0
@@ -1334,4 +1334,6 @@#define AR_PHY_65NM_RXRF_AGC_AGC_OUT 0x00000004#define AR_PHY_65NM_RXRF_AGC_AGC_OUT_S 2 +#define AR9300_DFS_FIRPWR -28 +#endif /* AR9003_PHY_H */
drivers/net/wireless/ath/ath9k/hw.h +1 -0
@@ -1044,6 +1044,7 @@ void ar9002_hw_enable_async_fifo(struct ath_hw *ah);* Code specific to AR9003, we stuff these here to avoid callbacks * for older families */ +bool ar9003_hw_bb_watchdog_check (struct ath_hw *ah);void ar9003_hw_bb_watchdog_config (struct ath_hw *ah);void ar9003_hw_bb_watchdog_read (struct ath_hw *ah);void ar9003_hw_bb_watchdog_dbg_info (struct ath_hw *ah);
Signature · 1 line
1.8.5.2
PATCH 8/11 ath9k: Fix baseband watchdog reset
In reply to Sujith ManoharanFrom: Sujith Manoharan <[email protected]>
Do a HW reset only for required signatures.
--- drivers/net/wireless/ath/ath9k/main.c | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-)
drivers/net/wireless/ath/ath9k/main.c +19 -8
@@ -448,14 +448,8 @@ void ath9k_tasklet(unsigned long data)ath9k_ps_wakeup (sc);spin_lock (&sc->sc_pcu_lock); -if ((status &ATH9K_INT_FATAL ) || - (status &ATH9K_INT_BB_WATCHDOG )) { - -if (status &ATH9K_INT_FATAL ) - type =RESET_TYPE_FATAL_INT ; -else - type =RESET_TYPE_BB_WATCHDOG ; - +if (status &ATH9K_INT_FATAL ) { + type =RESET_TYPE_FATAL_INT ;ath9k_queue_reset (sc, type);/*
@@ -467,6 +461,23 @@ void ath9k_tasklet(unsigned long data) goto out; } +if ((ah->config.hw_hang_checks &HW_BB_WATCHDOG ) && + (status &ATH9K_INT_BB_WATCHDOG )) { +if (ar9003_hw_bb_watchdog_check (ah)) { + type =RESET_TYPE_BB_WATCHDOG ; +ath9k_queue_reset (sc, type); + +/* +* Increment the ref. counter here so that +* interrupts are enabled in the reset routine. +*/ +atomic_inc (&ah->intr_ref_cnt); +ath_dbg (common,ANY , +"BB_WATCHDOG: Skipping interrupts\n" ); + goto out; + } + } +spin_lock_irqsave (&sc->sc_pm_lock, flags);if ((status &ATH9K_INT_TSFOOR ) && sc->ps_enabled) {/*
Signature · 1 line
1.8.5.2
PATCH 9/11 ath9k: Remove RX Poll
In reply to Sujith ManoharanFrom: Sujith Manoharan <[email protected]>
This patch removes the convoluted and hacky method of monitoring for connectivity. We rely on mac80211's connection loss logic and doing it in the driver is not necessary.
The HW check for MAC/BB hangs is also simplified, there is no need to have a separate work instance for it.
--- drivers/net/wireless/ath/ath9k/ath9k.h | 7 +--- drivers/net/wireless/ath/ath9k/beacon.c | 10 ++++-- drivers/net/wireless/ath/ath9k/init.c | 2 -- drivers/net/wireless/ath/ath9k/link.c | 63 +++++---------------------------- drivers/net/wireless/ath/ath9k/main.c | 7 ---- drivers/net/wireless/ath/ath9k/recv.c | 4 --- drivers/net/wireless/ath/ath9k/wow.c | 1 - 7 files changed, 17 insertions(+), 77 deletions(-)
drivers/net/wireless/ath/ath9k/ath9k.h +1 -6
@@ -455,10 +455,8 @@ bool ath9k_csa_is_finished(struct ath_softc *sc);void ath_tx_complete_poll_work (struct work_struct *work);void ath_reset_work (struct work_struct *work); -void ath_hw_check (struct work_struct *work); +bool ath_hw_check (struct ath_softc *sc);void ath_hw_pll_work (struct work_struct *work); -void ath_rx_poll (unsigned long data); -void ath_start_rx_poll (struct ath_softc *sc,u8 nbeacon);void ath_paprd_calibrate (struct work_struct *work);void ath_ani_calibrate (unsigned long data);void ath_start_ani (struct ath_softc *sc);
@@ -722,12 +720,10 @@ struct ath_softc {spinlock_t sc_pcu_lock;struct mutex mutex;struct work_struct paprd_work; -struct work_struct hw_check_work;struct work_struct hw_reset_work;struct completion paprd_complete;wait_queue_head_t tx_wait; -unsigned int hw_busy_count;unsigned long sc_flags;unsigned long driver_data;
@@ -761,7 +757,6 @@ struct ath_softc {struct ath_beacon_config cur_beacon_conf;struct delayed_work tx_complete_work;struct delayed_work hw_pll_work; -struct timer_list rx_poll_timer;struct timer_list sleep_timer;#ifdef CONFIG_ATH9K_BTCOEX_SUPPORT
drivers/net/wireless/ath/ath9k/beacon.c +8 -2
@@ -337,8 +337,14 @@ void ath9k_beacon_tasklet(unsigned long data)ath9k_hw_check_nav (ah); -if (!ath9k_hw_check_alive (ah)) -ieee80211_queue_work (sc->hw, &sc->hw_check_work); +/* +* If the previous beacon has not been transmitted +* and a MAC/BB hang has been identified, return +* here because a chip reset would have been +* initiated. +*/ +if (!ath_hw_check (sc)) +return ;if (sc->beacon.bmisscnt <BSTUCK_THRESH * sc->nbcnvifs) { ath_dbg(common, BSTUCK,
drivers/net/wireless/ath/ath9k/init.c +0 -2
@@ -763,10 +763,8 @@ static int ath9k_init_softc(u16 devid, struct ath_softc *sc,setup_timer (&sc->sleep_timer, ath_ps_full_sleep, (unsigned long )sc);INIT_WORK (&sc->hw_reset_work, ath_reset_work); -INIT_WORK (&sc->hw_check_work, ath_hw_check);INIT_WORK (&sc->paprd_work, ath_paprd_calibrate);INIT_DELAYED_WORK (&sc->hw_pll_work, ath_hw_pll_work); -setup_timer (&sc->rx_poll_timer, ath_rx_poll, (unsigned long )sc);/* * Cache line size is used to size and align various
drivers/net/wireless/ath/ath9k/link.c +8 -55
87 lines not on this page · raw message
drivers/net/wireless/ath/ath9k/main.c +0 -7
@@ -170,7 +170,6 @@ void ath9k_ps_restore(struct ath_softc *sc)static void __ath_cancel_work (struct ath_softc *sc) {cancel_work_sync (&sc->paprd_work); -cancel_work_sync (&sc->hw_check_work);cancel_delayed_work_sync (&sc->tx_complete_work);cancel_delayed_work_sync (&sc->hw_pll_work);
@@ -194,7 +193,6 @@ void ath_restart_work(struct ath_softc *sc)ieee80211_queue_delayed_work (sc->hw, &sc->hw_pll_work,msecs_to_jiffies (ATH_PLL_WORK_INTERVAL )); -ath_start_rx_poll (sc,3 );ath_start_ani (sc); }
@@ -204,11 +202,7 @@ static bool ath_prepare_reset(struct ath_softc *sc)bool ret = true;ieee80211_stop_queues (sc->hw); - - sc->hw_busy_count =0 ;ath_stop_ani (sc); -del_timer_sync (&sc->rx_poll_timer); -ath9k_hw_disable_interrupts (ah);if (!ath_drain_all_txq (sc))
@@ -867,7 +861,6 @@ static void ath9k_stop(struct ieee80211_hw *hw)mutex_lock (&sc->mutex);ath_cancel_work (sc); -del_timer_sync (&sc->rx_poll_timer);if (test_bit (SC_OP_INVALID , &sc->sc_flags)) {ath_dbg (common,ANY ,"Device not present\n" );
drivers/net/wireless/ath/ath9k/recv.c +0 -4
@@ -1077,10 +1077,6 @@ static int ath9k_rx_skb_preprocess(struct ath_softc *sc, } rx_stats->is_mybeacon =ath9k_is_mybeacon (sc, hdr); -if (rx_stats->is_mybeacon) { - sc->hw_busy_count =0 ; -ath_start_rx_poll (sc,3 ); - }if (ath9k_process_rate (common, hw, rx_stats, rx_status)) { ret =-EINVAL ;
drivers/net/wireless/ath/ath9k/wow.c +0 -1
@@ -197,7 +197,6 @@ int ath9k_suspend(struct ieee80211_hw *hw,ath_cancel_work (sc);ath_stop_ani (sc); -del_timer_sync (&sc->rx_poll_timer);if (test_bit (SC_OP_INVALID , &sc->sc_flags)) {ath_dbg (common,ANY ,"Device not present\n" );
Signature · 1 line
1.8.5.2
PATCH 10/11 ath9k: Process BB watchdog events in the tasklet
In reply to Sujith ManoharanFrom: Sujith Manoharan <[email protected]>
Move the BB processing code to the tasklet and avoid doing it in the ISR, there is no real benefit and this makes the ISR less heavy.
--- drivers/net/wireless/ath/ath9k/main.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-)
drivers/net/wireless/ath/ath9k/main.c +6 -8
@@ -457,6 +457,11 @@ void ath9k_tasklet(unsigned long data)if ((ah->config.hw_hang_checks &HW_BB_WATCHDOG ) && (status &ATH9K_INT_BB_WATCHDOG )) { +spin_lock (&common->cc_lock); +ath_hw_cycle_counters_update (common); +ar9003_hw_bb_watchdog_dbg_info (ah); +spin_unlock (&common->cc_lock); +if (ar9003_hw_bb_watchdog_check (ah)) { type =RESET_TYPE_BB_WATCHDOG ;ath9k_queue_reset (sc, type);
@@ -593,15 +598,8 @@ irqreturn_t ath_isr(int irq, void *dev) goto chip_reset;if ((ah->config.hw_hang_checks &HW_BB_WATCHDOG ) && - (status &ATH9K_INT_BB_WATCHDOG )) { - -spin_lock (&common->cc_lock); -ath_hw_cycle_counters_update (common); -ar9003_hw_bb_watchdog_dbg_info (ah); -spin_unlock (&common->cc_lock); - + (status &ATH9K_INT_BB_WATCHDOG )) goto chip_reset; - }#ifdef CONFIG_ATH9K_WOW if (status &ATH9K_INT_BMISS ) {
Signature · 1 line
1.8.5.2
PATCH 11/11 ath9k: Fix "cc_lock" usage
In reply to Sujith ManoharanFrom: Sujith Manoharan <[email protected]>
IRQ save/restore is not required for the cycle counters since they are accessed only from softirq and process context.
--- drivers/net/wireless/ath/ath9k/link.c | 4 ++-- drivers/net/wireless/ath/ath9k/main.c | 20 +++++++++----------- 2 files changed, 11 insertions(+), 13 deletions(-)
drivers/net/wireless/ath/ath9k/link.c +2 -2
@@ -362,10 +362,10 @@ void ath_ani_calibrate(unsigned long data)/* Call ANI routine if necessary */ if (aniflag) { -spin_lock_irqsave (&common->cc_lock, flags); +spin_lock_bh (&common->cc_lock);ath9k_hw_ani_monitor (ah, ah->curchan);ath_update_survey_stats (sc); -spin_unlock_irqrestore (&common->cc_lock, flags); +spin_unlock_bh (&common->cc_lock); }/* Perform calibration if necessary */
drivers/net/wireless/ath/ath9k/main.c +9 -11
@@ -118,11 +118,11 @@ void ath9k_ps_wakeup(struct ath_softc *sc)* survey data results. */ if (power_mode !=ATH9K_PM_AWAKE ) { -spin_lock (&common->cc_lock); +spin_lock_bh (&common->cc_lock);ath_hw_cycle_counters_update (common);memset (&common->cc_survey,0 ,sizeof (common->cc_survey));memset (&common->cc_ani,0 ,sizeof (common->cc_ani)); -spin_unlock (&common->cc_lock); +spin_unlock_bh (&common->cc_lock); } unlock:
@@ -157,9 +157,9 @@ void ath9k_ps_restore(struct ath_softc *sc) goto unlock; } -spin_lock (&common->cc_lock); +spin_lock_bh (&common->cc_lock);ath_hw_cycle_counters_update (common); -spin_unlock (&common->cc_lock); +spin_unlock_bh (&common->cc_lock);ath9k_hw_setpower (sc->sc_ah, mode);
@@ -330,7 +330,6 @@ static int ath_set_channel(struct ath_softc *sc, struct cfg80211_chan_def *chandstruct ieee80211_hw *hw = sc->hw;struct ath9k_channel *hchan;struct ieee80211_channel *chan = chandef->chan; -unsigned long flags;bool offchannel;int pos = chan->hw_value;int old_pos =-1 ;
@@ -348,9 +347,9 @@ static int ath_set_channel(struct ath_softc *sc, struct cfg80211_chan_def *chand chan->center_freq, chandef->width);/* update survey stats for the old channel before switching */ -spin_lock_irqsave (&common->cc_lock, flags); +spin_lock_bh (&common->cc_lock);ath_update_survey_stats (sc); -spin_unlock_irqrestore (&common->cc_lock, flags); +spin_unlock_bh (&common->cc_lock);ath9k_cmn_get_channel (hw, ah, chandef);
@@ -1789,13 +1788,12 @@ static int ath9k_get_survey(struct ieee80211_hw *hw, int idx,struct ath_common *common =ath9k_hw_common (sc->sc_ah);struct ieee80211_supported_band *sband;struct ieee80211_channel *chan; -unsigned long flags;int pos;if (config_enabled (CONFIG_ATH9K_TX99 ))return -EOPNOTSUPP ; -spin_lock_irqsave (&common->cc_lock, flags); +spin_lock_bh (&common->cc_lock);if (idx ==0 )ath_update_survey_stats (sc);
@@ -1809,7 +1807,7 @@ static int ath9k_get_survey(struct ieee80211_hw *hw, int idx, sband = hw->wiphy->bands[IEEE80211_BAND_5GHZ ];if (!sband || idx >= sband->n_channels) { -spin_unlock_irqrestore (&common->cc_lock, flags); +spin_unlock_bh (&common->cc_lock);return -ENOENT ; }
@@ -1817,7 +1815,7 @@ static int ath9k_get_survey(struct ieee80211_hw *hw, int idx, pos = chan->hw_value;memcpy (survey, &sc->survey[pos],sizeof (*survey)); survey->channel = chan; -spin_unlock_irqrestore (&common->cc_lock, flags); +spin_unlock_bh (&common->cc_lock);return 0 ; }
Signature · 1 line
1.8.5.2
Re: [PATCH 11/11] ath9k: Fix "cc_lock" usage
Quoted 6 lines · Sujith Manoharan
From: Sujith Manoharan <[email protected]>
IRQ save/restore is not required for the cycle counters since they are accessed only from softirq and process context.
Signed-off-by Sujith Manoharan <[email protected]>
I think you forgot to remove the now unused 'flags' variable in a few places.
- Felix
Re: [PATCH 11/11] ath9k: Fix "cc_lock" usage
Quoted 2 lines · Felix Fietkau
I think you forgot to remove the now unused 'flags' variable in a few places.
Which ones ? -Wunused-variable is enabled and gcc doesn't show any warnings...
Sujith
Re: [PATCH 11/11] ath9k: Fix "cc_lock" usage
Quoted 5 lines · Sujith Manoharan
Quoted 2 lines · Felix Fietkau
I think you forgot to remove the now unused 'flags' variable in a few places.
Which ones ? -Wunused-variable is enabled and gcc doesn't show any warnings...
Sorry, never mind. Something went wrong in my tree and the patch wasn't applied properly.
- Felix
PATCH v2 1/1 ath9k: Fix "cc_lock" usage
In reply to Sujith ManoharanFrom: Sujith Manoharan <[email protected]>
IRQ save/restore is not required for the cycle counters since they are accessed only from softirq and process context.
---
v2 : Avoid the warning,
"WARNING: CPU: 0 PID: 0 at /home/sujith/dev/wireless-testing/kernel/softirq.c:156 local_bh_enable_ip+0x92/0xd0()"
drivers/net/wireless/ath/ath9k/link.c | 4 ++-- drivers/net/wireless/ath/ath9k/main.c | 12 +++++------- 2 files changed, 7 insertions(+), 9 deletions(-)
drivers/net/wireless/ath/ath9k/link.c +2 -2
@@ -362,10 +362,10 @@ void ath_ani_calibrate(unsigned long data)/* Call ANI routine if necessary */ if (aniflag) { -spin_lock_irqsave (&common->cc_lock, flags); +spin_lock (&common->cc_lock);ath9k_hw_ani_monitor (ah, ah->curchan);ath_update_survey_stats (sc); -spin_unlock_irqrestore (&common->cc_lock, flags); +spin_unlock (&common->cc_lock); }/* Perform calibration if necessary */
drivers/net/wireless/ath/ath9k/main.c +5 -7
@@ -330,7 +330,6 @@ static int ath_set_channel(struct ath_softc *sc, struct cfg80211_chan_def *chandstruct ieee80211_hw *hw = sc->hw;struct ath9k_channel *hchan;struct ieee80211_channel *chan = chandef->chan; -unsigned long flags;bool offchannel;int pos = chan->hw_value;int old_pos =-1 ;
@@ -348,9 +347,9 @@ static int ath_set_channel(struct ath_softc *sc, struct cfg80211_chan_def *chand chan->center_freq, chandef->width);/* update survey stats for the old channel before switching */ -spin_lock_irqsave (&common->cc_lock, flags); +spin_lock_bh (&common->cc_lock);ath_update_survey_stats (sc); -spin_unlock_irqrestore (&common->cc_lock, flags); +spin_unlock_bh (&common->cc_lock);ath9k_cmn_get_channel (hw, ah, chandef);
@@ -1789,13 +1788,12 @@ static int ath9k_get_survey(struct ieee80211_hw *hw, int idx,struct ath_common *common =ath9k_hw_common (sc->sc_ah);struct ieee80211_supported_band *sband;struct ieee80211_channel *chan; -unsigned long flags;int pos;if (config_enabled (CONFIG_ATH9K_TX99 ))return -EOPNOTSUPP ; -spin_lock_irqsave (&common->cc_lock, flags); +spin_lock_bh (&common->cc_lock);if (idx ==0 )ath_update_survey_stats (sc);
@@ -1809,7 +1807,7 @@ static int ath9k_get_survey(struct ieee80211_hw *hw, int idx, sband = hw->wiphy->bands[IEEE80211_BAND_5GHZ ];if (!sband || idx >= sband->n_channels) { -spin_unlock_irqrestore (&common->cc_lock, flags); +spin_unlock_bh (&common->cc_lock);return -ENOENT ; }
@@ -1817,7 +1815,7 @@ static int ath9k_get_survey(struct ieee80211_hw *hw, int idx, pos = chan->hw_value;memcpy (survey, &sc->survey[pos],sizeof (*survey)); survey->channel = chan; -spin_unlock_irqrestore (&common->cc_lock, flags); +spin_unlock_bh (&common->cc_lock);return 0 ; }
Signature · 1 line
1.8.5.2