On 12/08/09 11:19, Gertjan van Wingerde wrote: > On Tue, Dec 8, 2009 at 10:57 AM, Andi Kleen <andi@xxxxxxxxxxxxxx> wrote: >>> This patch doesn't seem to change this particular issue, disabling >>> powersaving however makes rt62pci work again. >> >> Yes confirmed here. Haven't seen it in a day or so with disabled power >> saving. >> >> However I haven't tried the patch with power saving enabled. > > OK. > I think Stefan said that the patch didn't help for this issue. > > However, I've got an other hunch (based on the Ralink driver). Maybe > we shouldn't go to sleep when still TX entries are present. I'll cook > up a patch tonight. > OK. Please try again with the attached patch. Basically it disables going to sleep when there are still unacknowledged frames in the TX queues. This mirrors the behavior of the Ralink provided drivers. --- Gertjan.
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c index 687e17d..77b2575 100644 --- a/drivers/net/wireless/rt2x00/rt61pci.c +++ b/drivers/net/wireless/rt2x00/rt61pci.c @@ -947,9 +947,17 @@ static void rt61pci_config_ps(struct rt2x00_dev *rt2x00dev, enum dev_state state = (libconf->conf->flags & IEEE80211_CONF_PS) ? STATE_SLEEP : STATE_AWAKE; + struct data_queue *queue; u32 reg; if (state == STATE_SLEEP) { + /* + * Don't go to sleep when the TX queues aren't empty. + */ + tx_queue_for_each(rt2x00dev, queue) + if (!rt2x00queue_empty(queue)) { + return; + rt2x00pci_register_read(rt2x00dev, MAC_CSR11, ®); rt2x00_set_field32(®, MAC_CSR11_DELAY_AFTER_TBCN, rt2x00dev->beacon_int - 10);