2010-03-11 23:23:55

by Luis R. Rodriguez

[permalink] [raw]
Subject: [PATCH 0/2] ath5k: few AP fixes for 2.6.32

These patches were already merged into the latest 2.6.33.y,
however they are not yet in the latest 2.6.32.y, they are
reported to make ath5k AP support rock solid by a few people.

For your conveinience I have also put these patches up here:

http://kernel.org/pub/linux/kernel/people/mcgrof/patches/ath5k/2010-03/ath5k-ap-fixes-32/

Bob Copeland (2):
ath5k: dont use external sleep clock in AP mode
ath5k: fix setup for CAB queue

drivers/net/wireless/ath/ath5k/ath5k.h | 2 +-
drivers/net/wireless/ath/ath5k/base.c | 22 +++++++++++++++++++---
drivers/net/wireless/ath/ath5k/qcu.c | 5 +++--
drivers/net/wireless/ath/ath5k/reset.c | 5 +++--
4 files changed, 26 insertions(+), 8 deletions(-)



2010-03-11 23:23:55

by Luis R. Rodriguez

[permalink] [raw]
Subject: [PATCH 1/2] ath5k: dont use external sleep clock in AP mode

From: Bob Copeland <[email protected]>

When using the external sleep clock in AP mode, the
TSF increments too quickly, causing beacon interval
to be much lower than it is supposed to be, resulting
in lots of beacon-not-ready interrupts.

This fixes http://bugzilla.kernel.org/show_bug.cgi?id=14802.

Signed-off-by: Bob Copeland <[email protected]>
Acked-by: Nick Kossifidis <[email protected]>
Signed-off-by: John W. Linville <[email protected]>
---
drivers/net/wireless/ath/ath5k/reset.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath5k/reset.c b/drivers/net/wireless/ath/ath5k/reset.c
index 34e13c7..257ea18 100644
--- a/drivers/net/wireless/ath/ath5k/reset.c
+++ b/drivers/net/wireless/ath/ath5k/reset.c
@@ -1382,8 +1382,9 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum nl80211_iftype op_mode,
* Set clocks to 32KHz operation and use an
* external 32KHz crystal when sleeping if one
* exists */
- if (ah->ah_version == AR5K_AR5212)
- ath5k_hw_set_sleep_clock(ah, true);
+ if (ah->ah_version == AR5K_AR5212 &&
+ ah->ah_op_mode != NL80211_IFTYPE_AP)
+ ath5k_hw_set_sleep_clock(ah, true);

/*
* Disable beacons and reset the register
--
1.6.3.3


2010-03-18 21:28:02

by Greg KH

[permalink] [raw]
Subject: Re: [stable] [PATCH 0/2] ath5k: few AP fixes for 2.6.32

On Thu, Mar 11, 2010 at 06:23:47PM -0500, Luis R. Rodriguez wrote:
> These patches were already merged into the latest 2.6.33.y,
> however they are not yet in the latest 2.6.32.y, they are
> reported to make ath5k AP support rock solid by a few people.
>
> For your conveinience I have also put these patches up here:

Odd, I don't see them in the 2.6.33.y tree, so I have also applied them
there, as well as for .32.

Hope you don't mind,

greg k-h

2010-03-11 23:23:55

by Luis R. Rodriguez

[permalink] [raw]
Subject: [PATCH 2/2] ath5k: fix setup for CAB queue

From: Bob Copeland <[email protected]>

The beacon sent gating doesn't seem to work with any combination
of flags. Thus, buffered frames tend to stay buffered forever,
using up tx descriptors.

Instead, use the DBA gating and hold transmission of the buffered
frames until 80% of the beacon interval has elapsed using the ready
time. This fixes the following error in AP mode:

ath5k phy0: no further txbuf available, dropping packet

Add a comment to acknowledge that this isn't the best solution.

Signed-off-by: Bob Copeland <[email protected]>
Acked-by: Nick Kossifidis <[email protected]>
Signed-off-by: John W. Linville <[email protected]>
---
drivers/net/wireless/ath/ath5k/ath5k.h | 2 +-
drivers/net/wireless/ath/ath5k/base.c | 22 +++++++++++++++++++---
drivers/net/wireless/ath/ath5k/qcu.c | 5 +++--
3 files changed, 23 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/ath/ath5k/ath5k.h b/drivers/net/wireless/ath/ath5k/ath5k.h
index 6cd5efc..8c2e633 100644
--- a/drivers/net/wireless/ath/ath5k/ath5k.h
+++ b/drivers/net/wireless/ath/ath5k/ath5k.h
@@ -540,7 +540,7 @@ struct ath5k_txq_info {
u32 tqi_cbr_period; /* Constant bit rate period */
u32 tqi_cbr_overflow_limit;
u32 tqi_burst_time;
- u32 tqi_ready_time; /* Not used */
+ u32 tqi_ready_time; /* Time queue waits after an event */
};

/*
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index 8a82c75..118c5c0 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -1487,7 +1487,8 @@ ath5k_beaconq_config(struct ath5k_softc *sc)

ret = ath5k_hw_get_tx_queueprops(ah, sc->bhalq, &qi);
if (ret)
- return ret;
+ goto err;
+
if (sc->opmode == NL80211_IFTYPE_AP ||
sc->opmode == NL80211_IFTYPE_MESH_POINT) {
/*
@@ -1514,10 +1515,25 @@ ath5k_beaconq_config(struct ath5k_softc *sc)
if (ret) {
ATH5K_ERR(sc, "%s: unable to update parameters for beacon "
"hardware queue!\n", __func__);
- return ret;
+ goto err;
}
+ ret = ath5k_hw_reset_tx_queue(ah, sc->bhalq); /* push to h/w */
+ if (ret)
+ goto err;

- return ath5k_hw_reset_tx_queue(ah, sc->bhalq); /* push to h/w */;
+ /* reconfigure cabq with ready time to 80% of beacon_interval */
+ ret = ath5k_hw_get_tx_queueprops(ah, AR5K_TX_QUEUE_ID_CAB, &qi);
+ if (ret)
+ goto err;
+
+ qi.tqi_ready_time = (sc->bintval * 80) / 100;
+ ret = ath5k_hw_set_tx_queueprops(ah, AR5K_TX_QUEUE_ID_CAB, &qi);
+ if (ret)
+ goto err;
+
+ ret = ath5k_hw_reset_tx_queue(ah, AR5K_TX_QUEUE_ID_CAB);
+err:
+ return ret;
}

static void
diff --git a/drivers/net/wireless/ath/ath5k/qcu.c b/drivers/net/wireless/ath/ath5k/qcu.c
index eeebb9a..b7c5725 100644
--- a/drivers/net/wireless/ath/ath5k/qcu.c
+++ b/drivers/net/wireless/ath/ath5k/qcu.c
@@ -408,12 +408,13 @@ int ath5k_hw_reset_tx_queue(struct ath5k_hw *ah, unsigned int queue)
break;

case AR5K_TX_QUEUE_CAB:
+ /* XXX: use BCN_SENT_GT, if we can figure out how */
AR5K_REG_ENABLE_BITS(ah, AR5K_QUEUE_MISC(queue),
- AR5K_QCU_MISC_FRSHED_BCN_SENT_GT |
+ AR5K_QCU_MISC_FRSHED_DBA_GT |
AR5K_QCU_MISC_CBREXP_DIS |
AR5K_QCU_MISC_CBREXP_BCN_DIS);

- ath5k_hw_reg_write(ah, ((AR5K_TUNE_BEACON_INTERVAL -
+ ath5k_hw_reg_write(ah, ((tq->tqi_ready_time -
(AR5K_TUNE_SW_BEACON_RESP -
AR5K_TUNE_DMA_BEACON_RESP) -
AR5K_TUNE_ADDITIONAL_SWBA_BACKOFF) * 1024) |
--
1.6.3.3


2010-03-18 21:44:48

by Luis R. Rodriguez

[permalink] [raw]
Subject: Re: [stable] [PATCH 0/2] ath5k: few AP fixes for 2.6.32

On Thu, Mar 18, 2010 at 2:24 PM, Greg KH <[email protected]> wrote:
> On Thu, Mar 11, 2010 at 06:23:47PM -0500, Luis R. Rodriguez wrote:
>> These patches were already merged into the latest 2.6.33.y,
>> however they are not yet in the latest 2.6.32.y, they are
>> reported to make ath5k AP support rock solid by a few people.
>>
>> For your conveinience I have also put these patches up here:
>
> Odd, I don't see them in the 2.6.33.y tree, so I have also applied them
> there, as well as for .32.
>
> Hope you don't mind,

Wow, thought they were, yes please thanks.

Luis

2010-03-13 12:52:39

by Jon Fairbairn

[permalink] [raw]
Subject: Re: [PATCH 0/2] ath5k: few AP fixes for 2.6.32

"Luis R. Rodriguez"
<[email protected]> writes:

> These patches were already merged into the latest 2.6.33.y,
> however they are not yet in the latest 2.6.32.y, they are
> reported to make ath5k AP support rock solid by a few people.
>
> For your conveinience I have also put these patches up here:
>
> http://kernel.org/pub/linux/kernel/people/mcgrof/patches/ath5k/2010-03/ath5k-ap-fixes-32/

Apologies for being ignorant of process, but which bundle of
compat-wireless do (/will?) these patches appear in, and which
version of 2.6.32 will they be in?

I'm running an ath5k AP on a 64-bit Fedora 12 system, and while
it was pretty reliable on 2.6.31, a recent update took the
version to 2.6.32 (currently running 3.6.32.9-67, and next
update is to 2.6.32.9-70 in case the Fedora version numbers make
sense to anyone reading this), and I'm getting the "no further
txbuf" issue, so I'd like to build a version of the module with
these patches, but ideally not a bleeding edge one.

Thanks,

Jón

--
Jón Fairbairn [email protected]