linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stanislaw Gruszka <sgruszka@redhat.com>
To: Jakub Kicinski <moorray@wp.pl>
Cc: "John W. Linville" <linville@tuxdriver.com>,
	linux-wireless@vger.kernel.org, users@rt2x00.serialmonkey.com
Subject: Re: [rt2x00-users] [PATCH 3/5] rt2x00: rt2800usb: rework txstatus code
Date: Mon, 19 Mar 2012 08:52:24 +0100	[thread overview]
Message-ID: <20120319075223.GC2251@redhat.com> (raw)
In-Reply-To: <20120317175311.1cf09433@north>

On Sat, Mar 17, 2012 at 05:53:11PM +0100, Jakub Kicinski wrote:
> I feel a bit guilty to comment on a patch you have first posted more
> than a week ago and that have already been merged but to jump in with
No problems, it's never too late for code review :-)

> > Make changes on txdone work. Schedule it from
> > rt2800usb_tx_sta_fifo_read_completed() callback when first valid status
> > show up. Check in callback if tx status timeout happens, and schedule
> > work on that condition too. That make possible to remove tx status
> > timeout from generic watchdog. I moved that to rt2800usb.
> 
> Does above mean that you want to check for timeouts in
> rt2800usb_tx_sta_fifo_read_completed? You don't seem to be doing so.
Good catch, I'll post fix shortly.

> > +	if (rt2800usb_txstatus_pending(rt2x00dev) &&
> > +	    test_and_set_bit(TX_STATUS_READING, &rt2x00dev->flags))
> 
> I would put a bang before that test_and...
I don't understand what you mean, perhaps you could post a patch
or provide code snipset here, so I could comment.
 
> > +	while (!kfifo_is_empty(&rt2x00dev->txstatus_fifo) ||
> > +	       rt2800usb_txstatus_timeout(rt2x00dev)) {
> >  
> > -	rt2800usb_txdone_nostatus(rt2x00dev);
> > +		rt2800usb_txdone(rt2x00dev);
> >  
> > -	/*
> > -	 * The hw may delay sending the packet after DMA complete
> > -	 * if the medium is busy, thus the TX_STA_FIFO entry is
> > -	 * also delayed -> use a timer to retrieve it.
> > -	 */
> > -	if (rt2800usb_txstatus_pending(rt2x00dev))
> > -		mod_timer(&rt2x00dev->txstatus_timer, jiffies + msecs_to_jiffies(2));
> > +		rt2800usb_txdone_nostatus(rt2x00dev);
> > +
> > +		/*
> > +		 * The hw may delay sending the packet after DMA complete
> > +		 * if the medium is busy, thus the TX_STA_FIFO entry is
> > +		 * also delayed -> use a timer to retrieve it.
> > +		 */
> > +		if (rt2800usb_txstatus_pending(rt2x00dev))
> > +			rt2800usb_async_read_tx_status(rt2x00dev);
> 
> How is it possible that this call will ever start the timer? The
> reading "thread" won't exit if rt2800usb_txstatus_pending returns true
> and every dma_done will schedule reading itself.

I do not understand your objection here too. If rt2800usb_txstatus_pending()
will return true and if TX_STATUS_READING bit is not set, we will run hrtimer
to read status after 500 micro seconds. We exit the loop if kfifo is empty
and no entry timed out waiting to get corresponding TX status.

Thanks
Stanislaw

  reply	other threads:[~2012-03-19  7:52 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-14 10:16 [PATCH 1/5] rt2x00: rt2800usb: move additional txdone into new function Stanislaw Gruszka
2012-03-14 10:16 ` [PATCH 2/5] rt2x00: rt2800usb: rework txdone code Stanislaw Gruszka
2012-03-14 10:16 ` [PATCH 3/5] rt2x00: rt2800usb: rework txstatus code Stanislaw Gruszka
2012-03-17 16:53   ` [rt2x00-users] " Jakub Kicinski
2012-03-19  7:52     ` Stanislaw Gruszka [this message]
2012-03-19 13:13       ` Jakub Kicinski
2012-03-19 14:29         ` Stanislaw Gruszka
2012-03-14 10:16 ` [PATCH 4/5] rt2x00: rt2800usb: do not check packedid for aggregated frames Stanislaw Gruszka
2012-03-14 10:16 ` [PATCH 5/5] rt2x00: rt2800usb: limit tx queues length Stanislaw Gruszka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120319075223.GC2251@redhat.com \
    --to=sgruszka@redhat.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=moorray@wp.pl \
    --cc=users@rt2x00.serialmonkey.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).