* [117/151] ath9k: Fix TX hang poll routine
[not found] <20091217040208.GA26571@kroah.com>
@ 2009-12-17 3:56 ` Greg KH
2009-12-17 3:56 ` [118/151] ath9k: fix processing of TX PS null data frames Greg KH
` (3 subsequent siblings)
4 siblings, 0 replies; 5+ messages in thread
From: Greg KH @ 2009-12-17 3:56 UTC (permalink / raw)
To: linux-kernel, stable, greg
Cc: stable-review, torvalds, akpm, alan, linux-wireless, Sujith,
Luis R. Rodriguez
2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Sujith <Sujith.Manoharan@atheros.com>
This is a backport of upstream commit: 332c556633b8c5fb4e890b1783122f2315526590
When TX is hung, the chip is reset. Ensure that
the chip is awake by using the PS wrappers.
Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/net/wireless/ath/ath9k/xmit.c | 2 ++
1 file changed, 2 insertions(+)
--- a/drivers/net/wireless/ath/ath9k/xmit.c
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
@@ -2065,7 +2065,9 @@ static void ath_tx_complete_poll_work(st
if (needreset) {
DPRINTF(sc, ATH_DBG_RESET, "tx hung, resetting the chip\n");
+ ath9k_ps_wakeup(sc);
ath_reset(sc, false);
+ ath9k_ps_restore(sc);
}
ieee80211_queue_delayed_work(sc->hw, &sc->tx_complete_work,
^ permalink raw reply [flat|nested] 5+ messages in thread
* [118/151] ath9k: fix processing of TX PS null data frames
[not found] <20091217040208.GA26571@kroah.com>
2009-12-17 3:56 ` [117/151] ath9k: Fix TX hang poll routine Greg KH
@ 2009-12-17 3:56 ` Greg KH
2009-12-17 3:56 ` [119/151] ath9k: Fix maximum tx fifo settings for single stream devices Greg KH
` (2 subsequent siblings)
4 siblings, 0 replies; 5+ messages in thread
From: Greg KH @ 2009-12-17 3:56 UTC (permalink / raw)
To: linux-kernel, stable, greg
Cc: stable-review, torvalds, akpm, alan, linux-wireless,
Luis R. Rodriguez, Vasanthakumar Thiagarajan, Vivek Natarajan
2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: "Luis R. Rodriguez" <lrodriguez@atheros.com>
This is a backport of upstream commit: e7824a50662f7f79b1a739f705b4d906c31cf221
When mac80211 was telling us to go into Powersave we listened
and immediately turned RX off. This meant hardware would not
see the ACKs from the AP we're associated with and hardware
we'd end up retransmiting the null data frame in a loop
helplessly.
Fix this by keeping track of the transmitted nullfunc frames
and only when we are sure the AP has sent back an ACK do we
go ahead and shut RX off.
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: Vivek Natarajan <Vivek.Natarajan@atheros.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/net/wireless/ath/ath9k/ath9k.h | 3 +++
drivers/net/wireless/ath/ath9k/mac.c | 2 ++
drivers/net/wireless/ath/ath9k/mac.h | 1 +
drivers/net/wireless/ath/ath9k/main.c | 9 ++++++++-
drivers/net/wireless/ath/ath9k/xmit.c | 16 ++++++++++++++++
5 files changed, 30 insertions(+), 1 deletion(-)
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
@@ -139,6 +139,7 @@ struct ath_buf {
dma_addr_t bf_daddr; /* physical addr of desc */
dma_addr_t bf_buf_addr; /* physical addr of data buffer */
bool bf_stale;
+ bool bf_isnullfunc;
u16 bf_flags;
struct ath_buf_state bf_state;
dma_addr_t bf_dmacontext;
@@ -524,6 +525,8 @@ struct ath_led {
#define SC_OP_BEACON_SYNC BIT(19)
#define SC_OP_BTCOEX_ENABLED BIT(20)
#define SC_OP_BT_PRIORITY_DETECTED BIT(21)
+#define SC_OP_NULLFUNC_COMPLETED BIT(22)
+#define SC_OP_PS_ENABLED BIT(23)
struct ath_bus_ops {
void (*read_cachesize)(struct ath_softc *sc, int *csz);
--- a/drivers/net/wireless/ath/ath9k/mac.c
+++ b/drivers/net/wireless/ath/ath9k/mac.c
@@ -222,6 +222,8 @@ int ath9k_hw_txprocdesc(struct ath_hw *a
ds->ds_txstat.ts_status = 0;
ds->ds_txstat.ts_flags = 0;
+ if (ads->ds_txstatus1 & AR_FrmXmitOK)
+ ds->ds_txstat.ts_status |= ATH9K_TX_ACKED;
if (ads->ds_txstatus1 & AR_ExcessiveRetries)
ds->ds_txstat.ts_status |= ATH9K_TXERR_XRETRY;
if (ads->ds_txstatus1 & AR_Filtered)
--- a/drivers/net/wireless/ath/ath9k/mac.h
+++ b/drivers/net/wireless/ath/ath9k/mac.h
@@ -76,6 +76,7 @@
#define ATH9K_TXERR_FIFO 0x04
#define ATH9K_TXERR_XTXOP 0x08
#define ATH9K_TXERR_TIMER_EXPIRED 0x10
+#define ATH9K_TX_ACKED 0x20
#define ATH9K_TX_BA 0x01
#define ATH9K_TX_PWRMGMT 0x02
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -2327,6 +2327,7 @@ static int ath9k_config(struct ieee80211
if (changed & IEEE80211_CONF_CHANGE_PS) {
if (conf->flags & IEEE80211_CONF_PS) {
+ sc->sc_flags |= SC_OP_PS_ENABLED;
if (!(ah->caps.hw_caps &
ATH9K_HW_CAP_AUTOSLEEP)) {
if ((sc->imask & ATH9K_INT_TIM_TIMER) == 0) {
@@ -2334,11 +2335,17 @@ static int ath9k_config(struct ieee80211
ath9k_hw_set_interrupts(sc->sc_ah,
sc->imask);
}
- ath9k_hw_setrxabort(sc->sc_ah, 1);
}
sc->ps_enabled = true;
+ if ((sc->sc_flags & SC_OP_NULLFUNC_COMPLETED)) {
+ sc->sc_flags &= ~SC_OP_NULLFUNC_COMPLETED;
+ sc->ps_enabled = true;
+ ath9k_hw_setrxabort(sc->sc_ah, 1);
+ }
} else {
sc->ps_enabled = false;
+ sc->sc_flags &= ~(SC_OP_PS_ENABLED |
+ SC_OP_NULLFUNC_COMPLETED);
ath9k_hw_setpower(sc->sc_ah, ATH9K_PM_AWAKE);
if (!(ah->caps.hw_caps &
ATH9K_HW_CAP_AUTOSLEEP)) {
--- a/drivers/net/wireless/ath/ath9k/xmit.c
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
@@ -1592,6 +1592,13 @@ static int ath_tx_setup_buffer(struct ie
}
bf->bf_buf_addr = bf->bf_dmacontext;
+
+ if (ieee80211_is_nullfunc(fc) && ieee80211_has_pm(fc)) {
+ bf->bf_isnullfunc = true;
+ sc->sc_flags &= ~SC_OP_NULLFUNC_COMPLETED;
+ } else
+ bf->bf_isnullfunc = false;
+
return 0;
}
@@ -1989,6 +1996,15 @@ static void ath_tx_processq(struct ath_s
if (ds == txq->axq_gatingds)
txq->axq_gatingds = NULL;
+ if (bf->bf_isnullfunc &&
+ (ds->ds_txstat.ts_status & ATH9K_TX_ACKED)) {
+ if ((sc->sc_flags & SC_OP_PS_ENABLED)) {
+ sc->ps_enabled = true;
+ ath9k_hw_setrxabort(sc->sc_ah, 1);
+ } else
+ sc->sc_flags |= SC_OP_NULLFUNC_COMPLETED;
+ }
+
/*
* Remove ath_buf's of the same transmit unit from txq,
* however leave the last descriptor back as the holding
^ permalink raw reply [flat|nested] 5+ messages in thread
* [119/151] ath9k: Fix maximum tx fifo settings for single stream devices
[not found] <20091217040208.GA26571@kroah.com>
2009-12-17 3:56 ` [117/151] ath9k: Fix TX hang poll routine Greg KH
2009-12-17 3:56 ` [118/151] ath9k: fix processing of TX PS null data frames Greg KH
@ 2009-12-17 3:56 ` Greg KH
2009-12-17 3:56 ` [120/151] ath9k: fix tx status reporting Greg KH
2009-12-17 3:56 ` [121/151] mac80211: Fix dynamic power save for scanning Greg KH
4 siblings, 0 replies; 5+ messages in thread
From: Greg KH @ 2009-12-17 3:56 UTC (permalink / raw)
To: linux-kernel, stable, greg
Cc: stable-review, torvalds, akpm, alan, linux-wireless,
Luis R. Rodriguez, Kyungwan Nam, Bennyam Malavazi, Stephen Chen,
Shan Palanisamy, Paul Shaw, Vasanthakumar Thiagarajan
2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: "Luis R. Rodriguez" <lrodriguez@atheros.com>
This is a backport of upstream commit: f4709fdf683e1ed37b321c258b614ebe39752bf3
Atheros single stream AR9285 and AR9271 have half the PCU TX FIFO
buffer size of that of dual stream devices. Dual stream devices
have a max PCU TX FIFO size of 8 KB while single stream devices
have 4 KB. Single stream devices have an issue though and require
hardware only to use half of the amount of its capable PCU TX FIFO
size, 2 KB and this requires a change in software.
Technically a change would not have been required (except for frame
burst considerations of 128 bytes) if these devices would have been
able to use the full 4 KB of the PCU TX FIFO size but our systems
engineers recommend 2 KB to be used only. We enforce this through
software by reducing the max frame triggger level to 2 KB.
Fixing the max frame trigger level should then have a few benefits:
* The PER will now be adjusted as designed for underruns when the
max trigger level is reached. This should help alleviate the
bus as the rate control algorithm chooses a slower rate which
should ensure frames are transmitted properly under high system
bus load.
* The poll we use on our TX queues should now trigger and work
as designed for single stream devices. The hardware passes
data from each TX queue on the PCU TX FIFO queue respecting each
queue's priority. The new trigger level ensures this seeding of
the PCU TX FIFO queue occurs as designed which could mean avoiding
false resets and actually reseting hw correctly when a TX queue
is indeed stuck.
* Some undocumented / unsupported behaviour could have been triggered
when the max trigger level level was being set to 4 KB on single
stream devices. Its not clear what this issue was to me yet.
Cc: Kyungwan Nam <kyungwan.nam@atheros.com>
Cc: Bennyam Malavazi <bennyam.malavazi@atheros.com>
Cc: Stephen Chen <stephen.chen@atheros.com>
Cc: Shan Palanisamy <shan.palanisamy@atheros.com>
Cc: Paul Shaw <paul.shaw@atheros.com>
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/net/wireless/ath/ath9k/hw.c | 11 ++++++++++-
drivers/net/wireless/ath/ath9k/hw.h | 1 +
drivers/net/wireless/ath/ath9k/mac.c | 4 ++--
3 files changed, 13 insertions(+), 3 deletions(-)
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -937,6 +937,11 @@ int ath9k_hw_init(struct ath_hw *ah)
DPRINTF(ah->ah_sc, ATH_DBG_RESET, "serialize_regmode is %d\n",
ah->config.serialize_regmode);
+ if (AR_SREV_9285(ah) || AR_SREV_9271(ah))
+ ah->config.max_txtrig_level = MAX_TX_FIFO_THRESHOLD >> 1;
+ else
+ ah->config.max_txtrig_level = MAX_TX_FIFO_THRESHOLD;
+
if (!ath9k_hw_macversion_supported(ah->hw_version.macVersion)) {
DPRINTF(ah->ah_sc, ATH_DBG_FATAL,
"Mac Chip Rev 0x%02x.%x is not supported by "
@@ -3670,7 +3675,11 @@ void ath9k_hw_fill_cap_info(struct ath_h
pCap->keycache_size = AR_KEYTABLE_SIZE;
pCap->hw_caps |= ATH9K_HW_CAP_FASTCC;
- pCap->tx_triglevel_max = MAX_TX_FIFO_THRESHOLD;
+
+ if (AR_SREV_9285(ah) || AR_SREV_9271(ah))
+ pCap->tx_triglevel_max = MAX_TX_FIFO_THRESHOLD >> 1;
+ else
+ pCap->tx_triglevel_max = MAX_TX_FIFO_THRESHOLD;
if (AR_SREV_9285_10_OR_LATER(ah))
pCap->num_gpio_pins = AR9285_NUM_GPIO;
--- a/drivers/net/wireless/ath/ath9k/hw.h
+++ b/drivers/net/wireless/ath/ath9k/hw.h
@@ -218,6 +218,7 @@ struct ath9k_ops_config {
#define AR_SPUR_FEEQ_BOUND_HT20 10
int spurmode;
u16 spurchans[AR_EEPROM_MODAL_SPURS][2];
+ u8 max_txtrig_level;
};
enum ath9k_int {
--- a/drivers/net/wireless/ath/ath9k/mac.c
+++ b/drivers/net/wireless/ath/ath9k/mac.c
@@ -70,7 +70,7 @@ bool ath9k_hw_updatetxtriglevel(struct a
u32 txcfg, curLevel, newLevel;
enum ath9k_int omask;
- if (ah->tx_trig_level >= MAX_TX_FIFO_THRESHOLD)
+ if (ah->tx_trig_level >= ah->config.max_txtrig_level)
return false;
omask = ath9k_hw_set_interrupts(ah, ah->mask_reg & ~ATH9K_INT_GLOBAL);
@@ -79,7 +79,7 @@ bool ath9k_hw_updatetxtriglevel(struct a
curLevel = MS(txcfg, AR_FTRIG);
newLevel = curLevel;
if (bIncTrigLevel) {
- if (curLevel < MAX_TX_FIFO_THRESHOLD)
+ if (curLevel < ah->config.max_txtrig_level)
newLevel++;
} else if (curLevel > MIN_TX_FIFO_THRESHOLD)
newLevel--;
^ permalink raw reply [flat|nested] 5+ messages in thread
* [120/151] ath9k: fix tx status reporting
[not found] <20091217040208.GA26571@kroah.com>
` (2 preceding siblings ...)
2009-12-17 3:56 ` [119/151] ath9k: Fix maximum tx fifo settings for single stream devices Greg KH
@ 2009-12-17 3:56 ` Greg KH
2009-12-17 3:56 ` [121/151] mac80211: Fix dynamic power save for scanning Greg KH
4 siblings, 0 replies; 5+ messages in thread
From: Greg KH @ 2009-12-17 3:56 UTC (permalink / raw)
To: linux-kernel, stable, greg
Cc: stable-review, torvalds, akpm, alan, linux-wireless,
Felix Fietkau, Luis R. Rodriguez
2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Felix Fietkau <nbd@openwrt.org>
This is a backport of upstream commit: e8c6342d989e241513baeba4b05a04b6b1f3bc8b
This patch fixes a bug in ath9k's tx status check, which
caused mac80211 to consider regularly transmitted unicast frames
as un-acked.
When checking the ts_status field for errors, it needs to be masked
with ATH9K_TXERR_FILT, because this field also contains other fields
like ATH9K_TX_ACKED.
Without this patch, AP mode is pretty much unusable, as hostapd
checks the ACK status for the frames that it injects.
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/net/wireless/ath/ath9k/xmit.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/net/wireless/ath/ath9k/xmit.c
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
@@ -2020,7 +2020,7 @@ static void ath_tx_processq(struct ath_s
if (bf_isaggr(bf))
txq->axq_aggr_depth--;
- txok = (ds->ds_txstat.ts_status == 0);
+ txok = !(ds->ds_txstat.ts_status & ATH9K_TXERR_FILT);
txq->axq_tx_inprogress = false;
spin_unlock_bh(&txq->axq_lock);
^ permalink raw reply [flat|nested] 5+ messages in thread
* [121/151] mac80211: Fix dynamic power save for scanning.
[not found] <20091217040208.GA26571@kroah.com>
` (3 preceding siblings ...)
2009-12-17 3:56 ` [120/151] ath9k: fix tx status reporting Greg KH
@ 2009-12-17 3:56 ` Greg KH
4 siblings, 0 replies; 5+ messages in thread
From: Greg KH @ 2009-12-17 3:56 UTC (permalink / raw)
To: linux-kernel, stable, greg
Cc: stable-review, torvalds, akpm, alan, linux-wireless,
Vivek Natarajan, John W. Linville
2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Vivek Natarajan <vnatarajan@atheros.com>
Upstream commit: 7c3f4bbedc241ddcd3abe1f419c356e625231da1
Not only ps_sdata but also IEEE80211_CONF_PS is to be considered
before restoring PS in scan_ps_disable(). For instance, when ps_sdata
is set but CONF_PS is not set just because the dynamic timer is still
running, a sw scan leads to setting of CONF_PS in scan_ps_disable
instead of restarting the dynamic PS timer.
Also for the above case, a null data frame is to be sent after
returning to operating channel which was not happening with the
current implementation. This patch fixes this too.
Signed-off-by: Vivek Natarajan <vnatarajan@atheros.com>
Reviewed-by: Kalle Valo <kalle.valo@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
net/mac80211/ieee80211_i.h | 1 +
net/mac80211/scan.c | 20 ++++++++++++++++----
2 files changed, 17 insertions(+), 4 deletions(-)
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -808,6 +808,7 @@ struct ieee80211_local {
unsigned int wmm_acm; /* bit field of ACM bits (BIT(802.1D tag)) */
bool pspolling;
+ bool scan_ps_enabled;
/*
* PS can only be enabled when we have exactly one managed
* interface (and monitors) in PS, this then points there.
--- a/net/mac80211/scan.c
+++ b/net/mac80211/scan.c
@@ -196,7 +196,8 @@ ieee80211_scan_rx(struct ieee80211_sub_i
static void ieee80211_scan_ps_enable(struct ieee80211_sub_if_data *sdata)
{
struct ieee80211_local *local = sdata->local;
- bool ps = false;
+
+ local->scan_ps_enabled = false;
/* FIXME: what to do when local->pspolling is true? */
@@ -204,12 +205,13 @@ static void ieee80211_scan_ps_enable(str
cancel_work_sync(&local->dynamic_ps_enable_work);
if (local->hw.conf.flags & IEEE80211_CONF_PS) {
- ps = true;
+ local->scan_ps_enabled = true;
local->hw.conf.flags &= ~IEEE80211_CONF_PS;
ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_PS);
}
- if (!ps || !(local->hw.flags & IEEE80211_HW_PS_NULLFUNC_STACK))
+ if (!(local->scan_ps_enabled) ||
+ !(local->hw.flags & IEEE80211_HW_PS_NULLFUNC_STACK))
/*
* If power save was enabled, no need to send a nullfunc
* frame because AP knows that we are sleeping. But if the
@@ -230,7 +232,7 @@ static void ieee80211_scan_ps_disable(st
if (!local->ps_sdata)
ieee80211_send_nullfunc(local, sdata, 0);
- else {
+ else if (local->scan_ps_enabled) {
/*
* In !IEEE80211_HW_PS_NULLFUNC_STACK case the hardware
* will send a nullfunc frame with the powersave bit set
@@ -246,6 +248,16 @@ static void ieee80211_scan_ps_disable(st
*/
local->hw.conf.flags |= IEEE80211_CONF_PS;
ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_PS);
+ } else if (local->hw.conf.dynamic_ps_timeout > 0) {
+ /*
+ * If IEEE80211_CONF_PS was not set and the dynamic_ps_timer
+ * had been running before leaving the operating channel,
+ * restart the timer now and send a nullfunc frame to inform
+ * the AP that we are awake.
+ */
+ ieee80211_send_nullfunc(local, sdata, 0);
+ mod_timer(&local->dynamic_ps_timer, jiffies +
+ msecs_to_jiffies(local->hw.conf.dynamic_ps_timeout));
}
}
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-12-17 4:05 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20091217040208.GA26571@kroah.com>
2009-12-17 3:56 ` [117/151] ath9k: Fix TX hang poll routine Greg KH
2009-12-17 3:56 ` [118/151] ath9k: fix processing of TX PS null data frames Greg KH
2009-12-17 3:56 ` [119/151] ath9k: Fix maximum tx fifo settings for single stream devices Greg KH
2009-12-17 3:56 ` [120/151] ath9k: fix tx status reporting Greg KH
2009-12-17 3:56 ` [121/151] mac80211: Fix dynamic power save for scanning Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).