From: Gertjan van Wingerde <gwingerde@gmail.com>
To: Ondrej Zary <linux@rainbow-software.org>,
users@rt2x00.serialmonkey.com, linux-wireless@vger.kernel.org
Subject: Re: [PATCH] [RFC] rt2500pci: fix powersaving
Date: Wed, 31 Mar 2010 20:38:44 +0200 [thread overview]
Message-ID: <4BB396B4.8090005@gmail.com> (raw)
In-Reply-To: <20100331174138.GE21160@katherina.student.utwente.nl>
[-- Attachment #1: Type: text/plain, Size: 1372 bytes --]
On 03/31/10 19:41, Matthijs Kooijman wrote:
> Hi Ondrej,
>
>> phy0 -> rt2500pci_set_device_state: Error - Device failed to enter state 1 (-16).
> I've been running with your patches (applied to 2.6.32.7) for a day of normal
> work, and the steady stream of these errors has stopped. During the entire
> day, I've seen the error once, perhaps a corner case here or there?
>
> Overall, I have the feeling that connectivity is a bit more unstable with
> these two patches, however. On a few occasions, my SSH connections would hang
> for a bit. Sometimes pinging would be ok (and sometimes it wouldn't), so I
> haven't quite figured out if these problems were actually caused by the
> driver, or some other cause). Once I seemd to solve the problem by turning off
> powersaving, but that might have been a coincidence. Other times the problems
> went away by themselves.
>
> Is there anything else I can do at the moment I'm seeing connection problems?
> Make a register dump or check some command?
>
> I'll do some more testing, tonight on another (probably more stable)
> connection.
Could you try the attached patch on top of Ondrej's?
The legacy Ralink drivers do not go to sleep when there are still active entries
in the TX queues. This patch mimics that behavior by refusing to go to sleep if
there still are active entries in any of the TX queues.
---
Gertjan
[-- Attachment #2: patch --]
[-- Type: text/plain, Size: 788 bytes --]
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c
index c6d3f2c..a7ff006 100644
--- a/drivers/net/wireless/rt2x00/rt2500usb.c
+++ b/drivers/net/wireless/rt2x00/rt2500usb.c
@@ -633,9 +633,17 @@ static void rt2500usb_config_ps(struct rt2x00_dev *rt2x00dev,
enum dev_state state =
(libconf->conf->flags & IEEE80211_CONF_PS) ?
STATE_SLEEP : STATE_AWAKE;
+ struct data_queue *queue;
u16 reg;
if (state == STATE_SLEEP) {
+ /*
+ * Don't go to sleep when the TX queues are not empty.
+ */
+ tx_queue_for_each(rt2x00dev, queue)
+ if (!rt2x00queue_empty(queue))
+ return;
+
rt2500usb_register_read(rt2x00dev, MAC_CSR18, ®);
rt2x00_set_field16(®, MAC_CSR18_DELAY_AFTER_BEACON,
rt2x00dev->beacon_int - 20);
next prev parent reply other threads:[~2010-03-31 18:38 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-29 7:56 [PATCH] rt2500usb: fix powersaving random failures Ondrej Zary
2010-03-29 19:47 ` Gertjan van Wingerde
2010-03-29 21:00 ` [rt2x00-users] " Ivo van Doorn
2010-03-30 5:11 ` Gertjan van Wingerde
2010-03-30 6:01 ` Ondrej Zary
2010-03-30 12:33 ` Ondrej Zary
2010-03-30 12:38 ` Ondrej Zary
2010-03-30 12:56 ` Matthijs Kooijman
2010-03-30 20:09 ` [PATCH] [RFC] rt2500pci: fix powersaving Ondrej Zary
2010-03-30 20:32 ` Matthijs Kooijman
2010-03-30 20:38 ` [rt2x00-users] " Gertjan van Wingerde
2010-03-30 21:02 ` Gertjan van Wingerde
2010-03-30 21:35 ` Ondrej Zary
2010-03-30 21:44 ` Gertjan van Wingerde
2010-03-31 17:41 ` Matthijs Kooijman
2010-03-31 18:38 ` Gertjan van Wingerde [this message]
2010-03-31 18:46 ` Gertjan van Wingerde
2010-03-31 19:00 ` [rt2x00-users] " Matthijs Kooijman
2010-04-03 14:11 ` Gertjan van Wingerde
2010-04-03 15:28 ` Matthijs Kooijman
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=4BB396B4.8090005@gmail.com \
--to=gwingerde@gmail.com \
--cc=linux-wireless@vger.kernel.org \
--cc=linux@rainbow-software.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).