* [PATCH 1/2] ath9k: fix possible hang on flush
@ 2014-04-21 23:14 Tim Harvey
2014-04-21 23:14 ` [PATCH 2/2] ath9k: add a recv budget Tim Harvey
2014-04-29 12:02 ` [PATCH 1/2] ath9k: fix possible hang on flush Tim Harvey
0 siblings, 2 replies; 7+ messages in thread
From: Tim Harvey @ 2014-04-21 23:14 UTC (permalink / raw)
To: linux-wireless; +Cc: linville, nbd
If a flush is requested, make sure to clear the descriptor once we've
processed it.
This resolves a hang that will occur if all RX descriptors are full when a
flush is requested.
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
---
drivers/net/wireless/ath/ath9k/recv.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
index 6c9accd..e77a253 100644
--- a/drivers/net/wireless/ath/ath9k/recv.c
+++ b/drivers/net/wireless/ath/ath9k/recv.c
@@ -1113,14 +1113,13 @@ requeue_drop_frag:
}
requeue:
list_add_tail(&bf->list, &sc->rx.rxbuf);
- if (flush)
- continue;
if (edma) {
ath_rx_edma_buf_link(sc, qtype);
} else {
ath_rx_buf_relink(sc, bf);
- ath9k_hw_rxena(ah);
+ if (!flush)
+ ath9k_hw_rxena(ah);
}
} while (1);
--
1.8.3.2
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH 2/2] ath9k: add a recv budget
2014-04-21 23:14 [PATCH 1/2] ath9k: fix possible hang on flush Tim Harvey
@ 2014-04-21 23:14 ` Tim Harvey
2014-04-22 9:09 ` Felix Fietkau
2014-04-29 19:23 ` Adrian Chadd
2014-04-29 12:02 ` [PATCH 1/2] ath9k: fix possible hang on flush Tim Harvey
1 sibling, 2 replies; 7+ messages in thread
From: Tim Harvey @ 2014-04-21 23:14 UTC (permalink / raw)
To: linux-wireless; +Cc: linville, nbd
Implement a recv budget so that in cases of high traffic we still allow other
taskets to get processed.
Without this, we can encounter a host of issues during high wireless traffic
reception depending on system load including rcu stall's detected (ARM),
soft lockups, failure to service critical tasks such as watchdog resets,
and triggering of the tx stuck tasklet.
The same thing was proposed previously by Ben:
http://www.spinics.net/lists/linux-wireless/msg112891.html
The only difference here is that I make sure only processed packets are counted
in the budget by checking at the end of the rx loop.
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
---
drivers/net/wireless/ath/ath9k/recv.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
index e77a253..19df969 100644
--- a/drivers/net/wireless/ath/ath9k/recv.c
+++ b/drivers/net/wireless/ath/ath9k/recv.c
@@ -975,6 +975,7 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush, bool hp)
u64 tsf = 0;
unsigned long flags;
dma_addr_t new_buf_addr;
+ unsigned int budget = 512;
if (edma)
dma_type = DMA_BIDIRECTIONAL;
@@ -1121,6 +1122,9 @@ requeue:
if (!flush)
ath9k_hw_rxena(ah);
}
+
+ if (!budget--)
+ break;
} while (1);
if (!(ah->imask & ATH9K_INT_RXEOL)) {
--
1.8.3.2
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH 2/2] ath9k: add a recv budget
2014-04-21 23:14 ` [PATCH 2/2] ath9k: add a recv budget Tim Harvey
@ 2014-04-22 9:09 ` Felix Fietkau
2014-04-29 12:04 ` Tim Harvey
2014-04-29 19:23 ` Adrian Chadd
1 sibling, 1 reply; 7+ messages in thread
From: Felix Fietkau @ 2014-04-22 9:09 UTC (permalink / raw)
To: Tim Harvey, linux-wireless; +Cc: linville
On 2014-04-22 01:14, Tim Harvey wrote:
> Implement a recv budget so that in cases of high traffic we still allow other
> taskets to get processed.
>
> Without this, we can encounter a host of issues during high wireless traffic
> reception depending on system load including rcu stall's detected (ARM),
> soft lockups, failure to service critical tasks such as watchdog resets,
> and triggering of the tx stuck tasklet.
>
> The same thing was proposed previously by Ben:
> http://www.spinics.net/lists/linux-wireless/msg112891.html
>
> The only difference here is that I make sure only processed packets are counted
> in the budget by checking at the end of the rx loop.
>
> Signed-off-by: Tim Harvey <tharvey@gateworks.com>
For both patches:
Acked-by: Felix Fietkau <nbd@openwrt.org>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] ath9k: add a recv budget
2014-04-22 9:09 ` Felix Fietkau
@ 2014-04-29 12:04 ` Tim Harvey
2014-04-29 12:25 ` Felix Fietkau
0 siblings, 1 reply; 7+ messages in thread
From: Tim Harvey @ 2014-04-29 12:04 UTC (permalink / raw)
To: linux-wireless; +Cc: John Linville, ath9k-devel, Felix Fietkau, Ben Greear
On Tue, Apr 22, 2014 at 2:09 AM, Felix Fietkau <nbd@openwrt.org> wrote:
> On 2014-04-22 01:14, Tim Harvey wrote:
>> Implement a recv budget so that in cases of high traffic we still allow other
>> taskets to get processed.
>>
>> Without this, we can encounter a host of issues during high wireless traffic
>> reception depending on system load including rcu stall's detected (ARM),
>> soft lockups, failure to service critical tasks such as watchdog resets,
>> and triggering of the tx stuck tasklet.
>>
>> The same thing was proposed previously by Ben:
>> http://www.spinics.net/lists/linux-wireless/msg112891.html
>>
>> The only difference here is that I make sure only processed packets are counted
>> in the budget by checking at the end of the rx loop.
>>
>> Signed-off-by: Tim Harvey <tharvey@gateworks.com>
> For both patches:
> Acked-by: Felix Fietkau <nbd@openwrt.org>
>
+cc ath9k-devel@lists.ath9k.org
+cc Ben Greear
Any other ack's or comments on these? These address some fairly
long-standing bugs.
Tim
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] ath9k: add a recv budget
2014-04-29 12:04 ` Tim Harvey
@ 2014-04-29 12:25 ` Felix Fietkau
0 siblings, 0 replies; 7+ messages in thread
From: Felix Fietkau @ 2014-04-29 12:25 UTC (permalink / raw)
To: Tim Harvey, linux-wireless; +Cc: John Linville, ath9k-devel, Ben Greear
On 2014-04-29 14:04, Tim Harvey wrote:
> On Tue, Apr 22, 2014 at 2:09 AM, Felix Fietkau <nbd@openwrt.org> wrote:
>> On 2014-04-22 01:14, Tim Harvey wrote:
>>> Implement a recv budget so that in cases of high traffic we still allow other
>>> taskets to get processed.
>>>
>>> Without this, we can encounter a host of issues during high wireless traffic
>>> reception depending on system load including rcu stall's detected (ARM),
>>> soft lockups, failure to service critical tasks such as watchdog resets,
>>> and triggering of the tx stuck tasklet.
>>>
>>> The same thing was proposed previously by Ben:
>>> http://www.spinics.net/lists/linux-wireless/msg112891.html
>>>
>>> The only difference here is that I make sure only processed packets are counted
>>> in the budget by checking at the end of the rx loop.
>>>
>>> Signed-off-by: Tim Harvey <tharvey@gateworks.com>
>> For both patches:
>> Acked-by: Felix Fietkau <nbd@openwrt.org>
>>
>
> +cc ath9k-devel@lists.ath9k.org
> +cc Ben Greear
>
> Any other ack's or comments on these? These address some fairly
> long-standing bugs.
No need for further ack's or comments, since the change has been picked
up by John already.
- Felix
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] ath9k: add a recv budget
2014-04-21 23:14 ` [PATCH 2/2] ath9k: add a recv budget Tim Harvey
2014-04-22 9:09 ` Felix Fietkau
@ 2014-04-29 19:23 ` Adrian Chadd
1 sibling, 0 replies; 7+ messages in thread
From: Adrian Chadd @ 2014-04-29 19:23 UTC (permalink / raw)
To: Tim Harvey; +Cc: linux-wireless@vger.kernel.org, John Linville, Felix Fietkau
On 21 April 2014 16:14, Tim Harvey <tharvey@gateworks.com> wrote:
> Implement a recv budget so that in cases of high traffic we still allow other
> taskets to get processed.
>
> Without this, we can encounter a host of issues during high wireless traffic
> reception depending on system load including rcu stall's detected (ARM),
> soft lockups, failure to service critical tasks such as watchdog resets,
> and triggering of the tx stuck tasklet.
Are you also force rescheduling the Rx tasklet if you break?
You can definitely hit a race condition where you get RXEOL and RXDESC
before you run the scheduled RX tasklet. In that instance you may not
get any further interrupts until you re-poke the RX DMA engine. Adding
a FIFO entry may be enough, but it certainly isn't enough (ie, no
FIFOs) on pre-AR93xx chips.
(I've done the same thing in FreeBSD for the same reasons. It's ..
delicate to get right.)
-a
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/2] ath9k: fix possible hang on flush
2014-04-21 23:14 [PATCH 1/2] ath9k: fix possible hang on flush Tim Harvey
2014-04-21 23:14 ` [PATCH 2/2] ath9k: add a recv budget Tim Harvey
@ 2014-04-29 12:02 ` Tim Harvey
1 sibling, 0 replies; 7+ messages in thread
From: Tim Harvey @ 2014-04-29 12:02 UTC (permalink / raw)
To: linux-wireless; +Cc: Felix Fietkau, ath9k-devel, John Linville
On Mon, Apr 21, 2014 at 4:14 PM, Tim Harvey <tharvey@gateworks.com> wrote:
> If a flush is requested, make sure to clear the descriptor once we've
> processed it.
>
> This resolves a hang that will occur if all RX descriptors are full when a
> flush is requested.
>
> Signed-off-by: Tim Harvey <tharvey@gateworks.com>
> ---
> drivers/net/wireless/ath/ath9k/recv.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
> index 6c9accd..e77a253 100644
> --- a/drivers/net/wireless/ath/ath9k/recv.c
> +++ b/drivers/net/wireless/ath/ath9k/recv.c
> @@ -1113,14 +1113,13 @@ requeue_drop_frag:
> }
> requeue:
> list_add_tail(&bf->list, &sc->rx.rxbuf);
> - if (flush)
> - continue;
>
> if (edma) {
> ath_rx_edma_buf_link(sc, qtype);
> } else {
> ath_rx_buf_relink(sc, bf);
> - ath9k_hw_rxena(ah);
> + if (!flush)
> + ath9k_hw_rxena(ah);
> }
> } while (1);
>
> --
> 1.8.3.2
>
+cc ath9k-devel@lists.ath9k.org
Tim
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2014-04-29 19:24 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-21 23:14 [PATCH 1/2] ath9k: fix possible hang on flush Tim Harvey
2014-04-21 23:14 ` [PATCH 2/2] ath9k: add a recv budget Tim Harvey
2014-04-22 9:09 ` Felix Fietkau
2014-04-29 12:04 ` Tim Harvey
2014-04-29 12:25 ` Felix Fietkau
2014-04-29 19:23 ` Adrian Chadd
2014-04-29 12:02 ` [PATCH 1/2] ath9k: fix possible hang on flush Tim Harvey
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).