Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH 0/2] ath5k: few AP fixes for 2.6.32
@ 2010-03-11 23:23 Luis R. Rodriguez
  2010-03-11 23:23 ` [PATCH 1/2] ath5k: dont use external sleep clock in AP mode Luis R. Rodriguez
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Luis R. Rodriguez @ 2010-03-11 23:23 UTC (permalink / raw)
  To: stable; +Cc: linville, mb, ath5k-devel, linux-wireless, Luis R. Rodriguez

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(-)


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/2] ath5k: dont use external sleep clock in AP mode
  2010-03-11 23:23 [PATCH 0/2] ath5k: few AP fixes for 2.6.32 Luis R. Rodriguez
@ 2010-03-11 23:23 ` Luis R. Rodriguez
  2010-03-11 23:23 ` [PATCH 2/2] ath5k: fix setup for CAB queue Luis R. Rodriguez
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Luis R. Rodriguez @ 2010-03-11 23:23 UTC (permalink / raw)
  To: stable; +Cc: linville, mb, ath5k-devel, linux-wireless, Bob Copeland

From: Bob Copeland <me@bobcopeland.com>

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 <me@bobcopeland.com>
Acked-by: Nick Kossifidis <mickflemm@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
---
 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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] ath5k: fix setup for CAB queue
  2010-03-11 23:23 [PATCH 0/2] ath5k: few AP fixes for 2.6.32 Luis R. Rodriguez
  2010-03-11 23:23 ` [PATCH 1/2] ath5k: dont use external sleep clock in AP mode Luis R. Rodriguez
@ 2010-03-11 23:23 ` Luis R. Rodriguez
  2010-03-13 12:52 ` [PATCH 0/2] ath5k: few AP fixes for 2.6.32 Jon Fairbairn
  2010-03-18 21:24 ` [stable] " Greg KH
  3 siblings, 0 replies; 6+ messages in thread
From: Luis R. Rodriguez @ 2010-03-11 23:23 UTC (permalink / raw)
  To: stable; +Cc: linville, mb, ath5k-devel, linux-wireless, Bob Copeland

From: Bob Copeland <me@bobcopeland.com>

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 <me@bobcopeland.com>
Acked-by: Nick Kossifidis <mickflemm@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
---
 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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 0/2] ath5k: few AP fixes for 2.6.32
  2010-03-11 23:23 [PATCH 0/2] ath5k: few AP fixes for 2.6.32 Luis R. Rodriguez
  2010-03-11 23:23 ` [PATCH 1/2] ath5k: dont use external sleep clock in AP mode Luis R. Rodriguez
  2010-03-11 23:23 ` [PATCH 2/2] ath5k: fix setup for CAB queue Luis R. Rodriguez
@ 2010-03-13 12:52 ` Jon Fairbairn
  2010-03-18 21:24 ` [stable] " Greg KH
  3 siblings, 0 replies; 6+ messages in thread
From: Jon Fairbairn @ 2010-03-13 12:52 UTC (permalink / raw)
  To: linux-wireless

"Luis R. Rodriguez"
<lrodriguez@atheros.com> 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                                 Jon.Fairbairn@cl.cam.ac.uk



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [stable] [PATCH 0/2] ath5k: few AP fixes for 2.6.32
  2010-03-11 23:23 [PATCH 0/2] ath5k: few AP fixes for 2.6.32 Luis R. Rodriguez
                   ` (2 preceding siblings ...)
  2010-03-13 12:52 ` [PATCH 0/2] ath5k: few AP fixes for 2.6.32 Jon Fairbairn
@ 2010-03-18 21:24 ` Greg KH
  2010-03-18 21:44   ` Luis R. Rodriguez
  3 siblings, 1 reply; 6+ messages in thread
From: Greg KH @ 2010-03-18 21:24 UTC (permalink / raw)
  To: Luis R. Rodriguez; +Cc: stable, linux-wireless, linville, mb, ath5k-devel

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [stable] [PATCH 0/2] ath5k: few AP fixes for 2.6.32
  2010-03-18 21:24 ` [stable] " Greg KH
@ 2010-03-18 21:44   ` Luis R. Rodriguez
  0 siblings, 0 replies; 6+ messages in thread
From: Luis R. Rodriguez @ 2010-03-18 21:44 UTC (permalink / raw)
  To: Greg KH; +Cc: stable, linux-wireless, linville, mb, ath5k-devel

On Thu, Mar 18, 2010 at 2:24 PM, Greg KH <greg@kroah.com> 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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-03-18 21:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-11 23:23 [PATCH 0/2] ath5k: few AP fixes for 2.6.32 Luis R. Rodriguez
2010-03-11 23:23 ` [PATCH 1/2] ath5k: dont use external sleep clock in AP mode Luis R. Rodriguez
2010-03-11 23:23 ` [PATCH 2/2] ath5k: fix setup for CAB queue Luis R. Rodriguez
2010-03-13 12:52 ` [PATCH 0/2] ath5k: few AP fixes for 2.6.32 Jon Fairbairn
2010-03-18 21:24 ` [stable] " Greg KH
2010-03-18 21:44   ` Luis R. Rodriguez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox