Unable to turn powersave for wlan0 off

Bug #1394163 reported by Michael Heuberger
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Invalid
Low
Unassigned

Bug Description

```
$ sudo iwconfig wlan0 power off
Error for wireless request "Set Power Management" (8B2C) :
    SET failed on device wlan0 ; Operation not supported.
```

No idea why. It should work and I have wlan0 listed here:

```
$ sudo iwconfig
[sudo] password for michael-heuberger:
eth0 no wireless extensions.

wlan0 IEEE 802.11bgn ESSID:off/any
          Mode:Managed Access Point: Not-Associated Tx-Power=off
          Retry short limit:7 RTS thr:off Fragment thr:off
          Encryption key:off
          Power Management:off

lo no wireless extensions.
```

Any clues? Or is this a bug? Thanks for helping!

ProblemType: Bug
DistroRelease: Ubuntu 14.10
Package: linux-image-3.16.0-24-generic 3.16.0-24.32
ProcVersionSignature: Ubuntu 3.16.0-24.32-generic 3.16.4
Uname: Linux 3.16.0-24-generic x86_64
NonfreeKernelModules: nvidia
ApportVersion: 2.14.7-0ubuntu8
Architecture: amd64
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC1: michael-heuberger 2109 F.... pulseaudio
 /dev/snd/controlC2: michael-heuberger 2109 F.... pulseaudio
 /dev/snd/controlC0: michael-heuberger 2109 F.... pulseaudio
CurrentDesktop: Unity
Date: Thu Nov 20 00:55:19 2014
HibernationDevice: RESUME=UUID=b0b47183-895a-4f27-bb25-40bd23028028
InstallationDate: Installed on 2014-10-31 (19 days ago)
InstallationMedia: Ubuntu 14.10 "Utopic Unicorn" - Release amd64 (20141022.1)
MachineType: System manufacturer System Product Name
ProcFB:

ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-3.16.0-24-generic root=UUID=b5b38333-3694-4441-8a13-50bf4dbf2f41 ro quiet
RelatedPackageVersions:
 linux-restricted-modules-3.16.0-24-generic N/A
 linux-backports-modules-3.16.0-24-generic N/A
 linux-firmware 1.138
RfKill:
 0: phy0: Wireless LAN
  Soft blocked: yes
  Hard blocked: no
SourcePackage: linux
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 08/06/2012
dmi.bios.vendor: American Megatrends Inc.
dmi.bios.version: 0803
dmi.board.asset.tag: To Be Filled By O.E.M.
dmi.board.name: P6X58D-E
dmi.board.vendor: ASUSTeK Computer INC.
dmi.board.version: Rev 1.xx
dmi.chassis.asset.tag: Asset-1234567890
dmi.chassis.type: 3
dmi.chassis.vendor: Chassis Manufacture
dmi.chassis.version: Chassis Version
dmi.modalias: dmi:bvnAmericanMegatrendsInc.:bvr0803:bd08/06/2012:svnSystemmanufacturer:pnSystemProductName:pvrSystemVersion:rvnASUSTeKComputerINC.:rnP6X58D-E:rvrRev1.xx:cvnChassisManufacture:ct3:cvrChassisVersion:
dmi.product.name: System Product Name
dmi.product.version: System Version
dmi.sys.vendor: System manufacturer

Revision history for this message
Michael Heuberger (michael.heuberger) wrote :
Revision history for this message
Brad Figg (brad-figg) wrote : Status changed to Confirmed

This change was made by a bot.

Changed in linux (Ubuntu):
status: New → Confirmed
Revision history for this message
Joseph Salisbury (jsalisbury) wrote :

Would it be possible for you to test the latest upstream kernel? Refer to https://wiki.ubuntu.com/KernelMainlineBuilds . Please test the latest v3.18 kernel[0].

If this bug is fixed in the mainline kernel, please add the following tag 'kernel-fixed-upstream'.

If the mainline kernel does not fix this bug, please add the tag: 'kernel-bug-exists-upstream'.

If you are unable to test the mainline kernel, for example it will not boot, please add the tag: 'kernel-unable-to-test-upstream'.
Once testing of the upstream kernel is complete, please mark this bug as "Confirmed".

Thanks in advance.

[0] http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.18-rc5-vivid/

Changed in linux (Ubuntu):
importance: Undecided → Medium
status: Confirmed → Incomplete
Revision history for this message
penalvch (penalvch) wrote :

Michael Heuberger, as per your Bug Description your Power Management is off. Hence, was it already off when you ran the command, or was it on, you ran the command, and then it was turned off?

I also get the same message as per the Bug Description if the Power Management is already off when I attempt to run the command.

tags: added: latest-bios-0803
Revision history for this message
Michael Heuberger (michael.heuberger) wrote :

Yes, power management is off on my side.

In that case it should NOT print an error. Just a warning. Because an error is misleading.

PS: Sorry, do not want to try the latest kernel. Had too many bad experiences installing beta kernels in the past.

tags: added: kernel-unable-to-test-upstream
Changed in linux (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
Seth Forshee (sforshee) wrote :

Here's a couple of possibilities.

First of all, iwconfig uses wireless extensions, which is deprecated but supported through emulation. I'm honestly not sure whether changing the power save option is expected to work that way. Try using 'sudo iw wlan0 get power_save" for reading the power save state and 'sudo iw wlan0 set powersave <state>" to set it, where <state> is either on or off.

The other possibility is that the ath9k.ps_enable is set then it's going to fail exactly as you describe. Please run 'cat /sys/module/ath9k/parameters/ps_enable'. I'm not sure off the top of my head what this will output, but if it's something like "1" or "yes" or "true" or "on" that means the flag is set and any attempt to change the power save state will fail in this manner. If it outputs something like "0" or "no" or "false" or "off" then the commands should succeed, even if you aren't changing the state.

Changed in linux (Ubuntu):
importance: Medium → Low
status: Confirmed → Incomplete
Revision history for this message
Seth Forshee (sforshee) wrote :

Oops, I've got a typo in comment #6. The command to change the power save state should be 'sudo iw wlan0 set power_save <state>", not "powersave".

Revision history for this message
Michael Heuberger (michael.heuberger) wrote :

Thanks.

```
$ sudo iw wlan0 set power_save off
```

seemed to work without any errors.

```
$ cat /sys/module/ath9k/parameters/ps_enable
0
```

Yes it returned a zero.

Changed in linux (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
Seth Forshee (sforshee) wrote :

I stated it backwards in comment #6 - if ps_enable is 0 then the operation should fail, and if it's 1 it should work. Since you're reading it as 0 (which is the default) that means power save support is disabled and the operation is going to fail. iw probably just doesn't output an error message in this case. If you use iw to enable power save (sudo iw wlan0 set power_save on) then read the state (sudo iw wlan0 get power_save) you should find that it's still disabled.

Since everything seems to be working as expected I'm closing this as invalid. You can change the value of ps_enable if you want to be able to enable/disable power save manually, but be warned that it sounds like the reason that it's disabled by default is that power save is broken with ath9k.

Changed in linux (Ubuntu):
status: Confirmed → Invalid
Revision history for this message
Michael Heuberger (michael.heuberger) wrote :

Ok, understood. Well, I spotted the error in my dmesg output. There was something else trying to turn the powersave off which failed of course and an error was printed. That confused me.

If I have power support disabled, then no entity should try to switch powersave off. This to prevent error pollution in the dmesg output. Looks like somewhere in the code an if-check is missing.

Revision history for this message
Seth Forshee (sforshee) wrote : Re: [Bug 1394163] Re: Unable to turn powersave for wlan0 off

On Sat, Nov 22, 2014 at 01:41:55AM -0000, Michael Heuberger wrote:
> Ok, understood. Well, I spotted the error in my dmesg output. There was
> something else trying to turn the powersave off which failed of course
> and an error was printed. That confused me.
>
> If I have power support disabled, then no entity should try to switch
> powersave off. This to prevent error pollution in the dmesg output.
> Looks like somewhere in the code an if-check is missing.

There are various PM scripts which might be trying to turn power save on
and off based on certain events (specifically applying or removing
external power). They can't really tell whether it was you which turned
off power save or if it was turned off due to an event, and I'm sure
they aren't smart enough to know about module options they should check.
The errors are safe to ignore.

Revision history for this message
Michael Heuberger (michael.heuberger) wrote :

Yeah, I reckon these errors are safe to ignore. My point is: they are misleading and can led to bug reports like this one :)

That's why they either shouldn't be displayed as an error in the dmesg output (change these to warnings maybe?) or make these PM scripts smarter by checking module options.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.