linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] rt2x00: rt2800usb: schedule txdone work on timeout
@ 2012-03-19  8:39 Stanislaw Gruszka
  2012-03-20  4:23 ` Gertjan van Wingerde
  0 siblings, 1 reply; 2+ messages in thread
From: Stanislaw Gruszka @ 2012-03-19  8:39 UTC (permalink / raw)
  To: John W. Linville; +Cc: linux-wireless, users, Jakub Kicinski, Stanislaw Gruszka

This is fix for my current commit
ed61e2b02027935520d1be884fac0b2ffce8379a
"rt2x00: rt2800usb: rework txdone code"

We should schedule txdone work on timeout, otherwise if newer get
tx status from hardware, we will never report tx status to mac80211
and eventually never wakeup tx queue.

Reported-by: Jakub Kicinski <moorray@wp.pl>
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
 drivers/net/wireless/rt2x00/rt2800usb.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/rt2x00/rt2800usb.c b/drivers/net/wireless/rt2x00/rt2800usb.c
index cd490ab..f97f846 100644
--- a/drivers/net/wireless/rt2x00/rt2800usb.c
+++ b/drivers/net/wireless/rt2x00/rt2800usb.c
@@ -163,7 +163,13 @@ static bool rt2800usb_tx_sta_fifo_read_completed(struct rt2x00_dev *rt2x00dev,
 
 		/* Reschedule urb to read TX status again instantly */
 		return true;
-	} else if (rt2800usb_txstatus_pending(rt2x00dev)) {
+	}
+
+	/* Check if there is any entry that timedout waiting on TX status */
+	if (rt2800usb_txstatus_timeout(rt2x00dev))
+		queue_work(rt2x00dev->workqueue, &rt2x00dev->txdone_work);
+
+	if (rt2800usb_txstatus_pending(rt2x00dev)) {
 		/* Read register after 250 us */
 		hrtimer_start(&rt2x00dev->txstatus_timer, ktime_set(0, 250000),
 			      HRTIMER_MODE_REL);
-- 
1.7.1


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

* Re: [PATCH] rt2x00: rt2800usb: schedule txdone work on timeout
  2012-03-19  8:39 [PATCH] rt2x00: rt2800usb: schedule txdone work on timeout Stanislaw Gruszka
@ 2012-03-20  4:23 ` Gertjan van Wingerde
  0 siblings, 0 replies; 2+ messages in thread
From: Gertjan van Wingerde @ 2012-03-20  4:23 UTC (permalink / raw)
  To: Stanislaw Gruszka; +Cc: John W. Linville, linux-wireless, users, Jakub Kicinski

On 03/19/12 09:39, Stanislaw Gruszka wrote:
> This is fix for my current commit
> ed61e2b02027935520d1be884fac0b2ffce8379a
> "rt2x00: rt2800usb: rework txdone code"
> 
> We should schedule txdone work on timeout, otherwise if newer get
> tx status from hardware, we will never report tx status to mac80211
> and eventually never wakeup tx queue.
> 
> Reported-by: Jakub Kicinski <moorray@wp.pl>
> Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>

Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>

> ---
>  drivers/net/wireless/rt2x00/rt2800usb.c |    8 +++++++-
>  1 files changed, 7 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/net/wireless/rt2x00/rt2800usb.c b/drivers/net/wireless/rt2x00/rt2800usb.c
> index cd490ab..f97f846 100644
> --- a/drivers/net/wireless/rt2x00/rt2800usb.c
> +++ b/drivers/net/wireless/rt2x00/rt2800usb.c
> @@ -163,7 +163,13 @@ static bool rt2800usb_tx_sta_fifo_read_completed(struct rt2x00_dev *rt2x00dev,
>  
>  		/* Reschedule urb to read TX status again instantly */
>  		return true;
> -	} else if (rt2800usb_txstatus_pending(rt2x00dev)) {
> +	}
> +
> +	/* Check if there is any entry that timedout waiting on TX status */
> +	if (rt2800usb_txstatus_timeout(rt2x00dev))
> +		queue_work(rt2x00dev->workqueue, &rt2x00dev->txdone_work);
> +
> +	if (rt2800usb_txstatus_pending(rt2x00dev)) {
>  		/* Read register after 250 us */
>  		hrtimer_start(&rt2x00dev->txstatus_timer, ktime_set(0, 250000),
>  			      HRTIMER_MODE_REL);


-- 
---
Gertjan

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

end of thread, other threads:[~2012-03-20  4:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-19  8:39 [PATCH] rt2x00: rt2800usb: schedule txdone work on timeout Stanislaw Gruszka
2012-03-20  4:23 ` Gertjan van Wingerde

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