linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Helmut Schaa <helmut.schaa@googlemail.com>
To: Joshua Smith <JoshuaESmith@charter.net>
Cc: "linux-wireless" <linux-wireless@vger.kernel.org>,
	users@rt2x00.serialmonkey.com, Ivo van Doorn <ivdoorn@gmail.com>
Subject: Re: Question about starting up an AP
Date: Fri, 15 Oct 2010 11:46:53 +0200	[thread overview]
Message-ID: <201010151146.53640.helmut.schaa@googlemail.com> (raw)
In-Reply-To: <B3E6C8F9-24E4-4F12-B19C-15A474E5BCFA@charter.net>

Am Donnerstag 14 Oktober 2010 schrieb Joshua Smith:
> OK, I finally got a chance to run the test.  Before doing the revert, I
> tried just using the current drivers, but with a ridiculously large
> number of retries.

Thanks for testing.

> Lo and behold: no error.  So I think this is the reason the old drivers
> were working for me, not anything that happened between July and September. 
> When I went back to the old drivers, I had made this change, and they
> worked.  I figured it was because I was using the old drivers, but now I
> realize it is because of this change.
> 
> Also, I can see the behavior pretty clearly.  Sometimes when I start up
> hostapd, it starts right up, and sometimes it takes about a second, and then
> starts up.  So it looks like this retry number just needs to be really,
> really big.  (Note that with this change in the old drivers, on very rare
> occasions, I still see the "busy, aborting" error.  So perhaps it should
> be even bigger than 1000?)
> 
> Not sure how you want to proceed with this, but this is the code that makes my AP work:
> 
>  nl compat-wireless-2010-09-20/drivers/net/wireless/rt2x00/rt2800lib.c | grep -C 10 1000/
> 
>    225	int rt2800_wait_wpdma_ready(struct rt2x00_dev *rt2x00dev)
>    226	{
>    227		unsigned int i;
>    228		u32 reg;
>        
>    229		for (i = 0; i < 1000/*REGISTER_BUSY_COUNT*/; i++) {
>    230			rt2800_register_read(rt2x00dev, WPDMA_GLO_CFG, &reg);
>    231			if (!rt2x00_get_field32(reg, WPDMA_GLO_CFG_TX_DMA_BUSY) &&
>    232			    !rt2x00_get_field32(reg, WPDMA_GLO_CFG_RX_DMA_BUSY))
>    233				return 0;
>        
>    234			msleep(1);
>    235		}
>        
>    236		ERROR(rt2x00dev, "WPDMA TX/RX busy, aborting.\n");
>    237		return -EACCES;

I'll let Ivo decide on this. At least if we really want to wait more then one
second for DMA to be ready we should increase the msleep(1) to msleep(10) and
keep the maximum number of retries at 100.

Joshua, did you ever ran the ralink legacy driver? Because that one also waits
a maximum of 100ms and thus would also fail sometimes ...

Helmut

  reply	other threads:[~2010-10-15 10:11 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-24 19:25 Question about starting up an AP Joshua Smith
2010-09-25  8:18 ` Helmut Schaa
2010-09-25  8:34 ` Helmut Schaa
     [not found]   ` <B17955D1-62BE-4A7E-8ECD-05FA62BD80B9@kaon.com>
2010-09-27 17:56     ` Helmut Schaa
2010-09-27 19:21       ` Joshua Smith
2010-09-27 19:43         ` Helmut Schaa
2010-09-27 20:26           ` Joshua Smith
2010-09-27 20:35             ` Helmut Schaa
2010-09-29 18:21               ` Joshua Smith
2010-09-30 15:52                 ` Joshua Smith
2010-09-30 16:14                   ` Helmut Schaa
2010-10-01  5:42                     ` Helmut Schaa
2010-10-14 17:16                       ` Joshua Smith
2010-10-15  9:46                         ` Helmut Schaa [this message]
2010-10-15 13:36                           ` Joshua Smith
2010-10-26  9:35                           ` Helmut Schaa
2010-10-26  9:41                             ` Johannes Berg
2010-10-26 10:04                               ` Helmut Schaa
2010-10-26 11:34                                 ` Ivo Van Doorn
2010-09-27 19:46         ` Helmut Schaa

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=201010151146.53640.helmut.schaa@googlemail.com \
    --to=helmut.schaa@googlemail.com \
    --cc=JoshuaESmith@charter.net \
    --cc=ivdoorn@gmail.com \
    --cc=linux-wireless@vger.kernel.org \
    --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).