2011-03-01 18:12:29

by Michael Büsch

[permalink] [raw]
Subject: Powersave broken on p54

Hi,

I'm using compat-wireless-2011-02-25 on my p54-spi device (n810).
Powersave is pretty much completely broken with this release.
With an older release from several weeks ago it used to work, though.

As soon as I enable PS, the link gets horrible latencies of
about 20 seconds or more per ping packet, for example.
It also saves hardly any power. (measured on the power supply).

Any ideas what could go wrong here?

--
Greetings Michael.



2011-03-07 17:22:09

by Michael Büsch

[permalink] [raw]
Subject: Re: Powersave broken on p54

On Wed, 2011-03-02 at 19:18 +0100, Christian Lamparter wrote:
> Not sure, don't have any hardware to play with ATM.
> But maybe the attached "hack" helps a bit?
> ---
> diff --git a/drivers/net/wireless/p54/fwio.c b/drivers/net/wireless/p54/fwio.c
> index 2fab7d2..df56a82 100644
> --- a/drivers/net/wireless/p54/fwio.c
> +++ b/drivers/net/wireless/p54/fwio.c
> @@ -615,8 +615,8 @@ int p54_set_ps(struct p54_common *priv)
> psm->mode = cpu_to_le16(mode);
> psm->aid = cpu_to_le16(priv->aid);
> for (i = 0; i < ARRAY_SIZE(psm->intervals); i++) {
> - psm->intervals[i].interval =
> - cpu_to_le16(priv->hw->conf.listen_interval);
> + psm->intervals[i].interval = cpu_to_le16(1);
> +// cpu_to_le16(priv->hw->conf.listen_interval);
> psm->intervals[i].periods = cpu_to_le16(1);
> }

This doesn't help.


--
Greetings, Michael.


2011-03-04 16:49:13

by Michael Büsch

[permalink] [raw]
Subject: Re: Powersave broken on p54

On Wed, 2011-03-02 at 19:18 +0100, Christian Lamparter wrote:
> > What change to the eeprom is needed? My eeprom doesn't
> > contain any rssi info (see recent NULL ptr fix).
>
> I think you should (re-)add it, I don't know what the
> firmware is doing with it, but maybe Kalle knows more?
>
> see "p54spi: update sample eeprom"
> 6c1cef43fb9d4979f9f7e0dcc71f61921730149b

Thanks for the hint. I added that stuff to the
CAL to p54 eeprom converter tool.

--
Greetings, Michael.


2011-03-08 07:43:55

by Kalle Valo

[permalink] [raw]
Subject: Re: Powersave broken on p54

Christian Lamparter <[email protected]> writes:

> On Wednesday 02 March 2011 18:17:37 Michael Buesch wrote:
>> On Wed, 2011-03-02 at 18:13 +0100, Christian Lamparter wrote:
>> > sure there was the rssi->dbm update (I hope you've already updated
>> > your eeprom image.)
>>
>> What change to the eeprom is needed? My eeprom doesn't
>> contain any rssi info (see recent NULL ptr fix).
>
> I think you should (re-)add it, I don't know what the
> firmware is doing with it, but maybe Kalle knows more?

Most probably it's just to get good rssi values for received frames
which is passed to the host. I doubt that the rssi calibration values
are used anything useful inside the firmware. But as always, anything
is possible :)

--
Kalle Valo

2011-03-02 17:17:43

by Michael Büsch

[permalink] [raw]
Subject: Re: Powersave broken on p54

On Wed, 2011-03-02 at 18:13 +0100, Christian Lamparter wrote:
> sure there was the rssi->dbm update (I hope you've already updated
> your eeprom image.)

What change to the eeprom is needed? My eeprom doesn't
contain any rssi info (see recent NULL ptr fix).

> No idea, it looks like the ps-poll is broken, because
> "iwconfig wlanX power timeout 10" fixes the long delays
> almost immediately. [let's see if there's more]

So maybe it's a generic mac80211 bug? Are there other
devices with PS issues?

--
Greetings, Michael.


2011-03-02 18:18:40

by Christian Lamparter

[permalink] [raw]
Subject: Re: Powersave broken on p54

On Wednesday 02 March 2011 18:17:37 Michael Buesch wrote:
> On Wed, 2011-03-02 at 18:13 +0100, Christian Lamparter wrote:
> > sure there was the rssi->dbm update (I hope you've already updated
> > your eeprom image.)
>
> What change to the eeprom is needed? My eeprom doesn't
> contain any rssi info (see recent NULL ptr fix).

I think you should (re-)add it, I don't know what the
firmware is doing with it, but maybe Kalle knows more?

see "p54spi: update sample eeprom"
6c1cef43fb9d4979f9f7e0dcc71f61921730149b

(Note: If the rssi values are missing, the driver uses
the default for Indigo/Duette/Frisbee and XBow RF.
But these parameter could confuse p54spi's Longbow RF?)

> > No idea, it looks like the ps-poll is broken, because
> > "iwconfig wlanX power timeout 10" fixes the long delays
> > almost immediately. [let's see if there's more]
>
> So maybe it's a generic mac80211 bug? Are there other
> devices with PS issues?
Not sure, don't have any hardware to play with ATM.
But maybe the attached "hack" helps a bit?
---
diff --git a/drivers/net/wireless/p54/fwio.c b/drivers/net/wireless/p54/fwio.c
index 2fab7d2..df56a82 100644
--- a/drivers/net/wireless/p54/fwio.c
+++ b/drivers/net/wireless/p54/fwio.c
@@ -615,8 +615,8 @@ int p54_set_ps(struct p54_common *priv)
psm->mode = cpu_to_le16(mode);
psm->aid = cpu_to_le16(priv->aid);
for (i = 0; i < ARRAY_SIZE(psm->intervals); i++) {
- psm->intervals[i].interval =
- cpu_to_le16(priv->hw->conf.listen_interval);
+ psm->intervals[i].interval = cpu_to_le16(1);
+// cpu_to_le16(priv->hw->conf.listen_interval);
psm->intervals[i].periods = cpu_to_le16(1);
}


2011-03-02 17:14:30

by Christian Lamparter

[permalink] [raw]
Subject: Re: Powersave broken on p54

On Tuesday 01 March 2011 19:12:22 Michael Büsch wrote:
> Hi,
>
> I'm using compat-wireless-2011-02-25 on my p54-spi device (n810).
> Powersave is pretty much completely broken with this release.
> With an older release from several weeks ago it used to work, though.
hmm, several weeks ago? Not alot was changed in the last few weeks,
sure there was the rssi->dbm update (I hope you've already updated
your eeprom image.) Then p54_flush and some tx_flag updates, but
the driver's PS code was not touched.

> As soon as I enable PS, the link gets horrible latencies of
> about 20 seconds or more per ping packet, for example.
> It also saves hardly any power. (measured on the power supply).
>
> Any ideas what could go wrong here?
No idea, it looks like the ps-poll is broken, because
"iwconfig wlanX power timeout 10" fixes the long delays
almost immediately. [let's see if there's more]

Regards,
Chr

2011-03-04 07:03:08

by Luciano Coelho

[permalink] [raw]
Subject: Re: Powersave broken on p54

On Wed, 2011-03-02 at 18:17 +0100, Michael Buesch wrote:
> On Wed, 2011-03-02 at 18:13 +0100, Christian Lamparter wrote:
> > sure there was the rssi->dbm update (I hope you've already updated
> > your eeprom image.)
>
> What change to the eeprom is needed? My eeprom doesn't
> contain any rssi info (see recent NULL ptr fix).
>
> > No idea, it looks like the ps-poll is broken, because
> > "iwconfig wlanX power timeout 10" fixes the long delays
> > almost immediately. [let's see if there's more]
>
> So maybe it's a generic mac80211 bug? Are there other
> devices with PS issues?

We have been having some problems with PSM on the wl12xx driver too. It
seems that it broke in the past couple of weeks as well. So this is
most likely a problem in mac80211. I'll try to investigate this a bit
more too.

--
Cheers,
Luca.


2011-03-04 17:11:45

by Luciano Coelho

[permalink] [raw]
Subject: Re: Powersave broken on p54

On Fri, 2011-03-04 at 09:03 +0200, Luciano Coelho wrote:
> On Wed, 2011-03-02 at 18:17 +0100, Michael Buesch wrote:
> > On Wed, 2011-03-02 at 18:13 +0100, Christian Lamparter wrote:
> > > sure there was the rssi->dbm update (I hope you've already updated
> > > your eeprom image.)
> >
> > What change to the eeprom is needed? My eeprom doesn't
> > contain any rssi info (see recent NULL ptr fix).
> >
> > > No idea, it looks like the ps-poll is broken, because
> > > "iwconfig wlanX power timeout 10" fixes the long delays
> > > almost immediately. [let's see if there's more]
> >
> > So maybe it's a generic mac80211 bug? Are there other
> > devices with PS issues?
>
> We have been having some problems with PSM on the wl12xx driver too. It
> seems that it broke in the past couple of weeks as well. So this is
> most likely a problem in mac80211. I'll try to investigate this a bit
> more too.

I've been investigating this problem a bit more and it seems that the
symptom, at least, is that when we receive data with the
more-data-buffered flag set, we immediately send a PS-poll which enables
PS mode again. My guess is that it shouldn't send PS-poll but a
null-frame with PS mode off.

I still need to refresh my PSM knowledge a bit more before I can
continue studying this. ;)


--
Cheers,
Luca.