Powertop makes wrong suggestion to add usbcore.autosuspend=1

Bug #136549 reported by Nic
118
This bug affects 11 people
Affects Status Importance Assigned to Milestone
powertop
Fix Released
Undecided
Unassigned
linux-source-2.6.22 (Ubuntu)
Invalid
Undecided
Unassigned
powertop (Debian)
Fix Released
Unknown
powertop (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

Binary package hint: powertop

Powertop makes wrong suggestion to enable "usbcore autosuspend=1" if it finds device set to autosuspend=0.
According to documentation of "Power Management for USB" (, Alan Stern <email address hidden>, October 5, 2007. )
kernel, up version 2.6.22, use 0 for "autosuspend as soon as the device becomes idle" but -1 means never to autosuspend.
......
The user interface for dynamic PM
.....
 power/autosuspend

                This file contains an integer value, which is the
                number of seconds the device should remain idle before
                the kernel will autosuspend it (the idle-delay time).
                The default is 2. 0 means to autosuspend as soon as
                the device becomes idle, and -1 means never to
                autosuspend. You can write a number to the file to
                change the autosuspend idle-delay time.

Writing "-1" to power/autosuspend and writing "on" to power/level do
essentially the same thing -- they both prevent the device from being
autosuspended. Yes, this is a redundancy in the API.

(In 2.6.21 writing "0" to power/autosuspend would prevent the device
from being autosuspended; the behavior was changed in 2.6.22. The
power/autosuspend attribute did not exist prior to 2.6.21, and the
power/level attribute did not exist prior to 2.6.22.)

Regards,
Alex

Revision history for this message
Evan Goers (megatog615) wrote :

Confirmed. Here's what Powertop says in full:

"Suggestion: Enable USB autosuspend by pressing the U key or adding
usbcore.autosuspend=1 to the kernel command line in the grub config"

After adding it to the defoptions in my menu.list(and running update-grup), the kernel throws up a warning saying that usbcore.autosuspend doesn't exist.

Revision history for this message
ɞєᾐ ἂ. (talkingwires) wrote :

I'm running Gutsy, but am using Debian's 2.6.22 kernel package. Ubuntu's 2.6.22 kernel is broken for Netgear MA401 PCMCIA wireless users. Debian's works fine.

Anyway, I have been toying around with Powertop, and noticed a large increase in battery life when I allowed it to apply its suggestions. However, some of them might not be worth the price. Googling around to find a way to make the applied suggestions permanent, I found a thread (http://lists.openwall.net/linux-kernel/2007/08/03/316) from Red Hat users that indicated that USB Autosuspend breaks a lot of printers because their drivers do not support it. They even gave a backhand compliment to the Ubuntu developers for not implementing it.

Anyway, adding the line to my Grub config doesn't work, either, but maybe that's a good thing?

Revision history for this message
ɞєᾐ ἂ. (talkingwires) wrote :

I found another, Ubuntu-specific thread (http://www.nabble.com/USB-Problems-with-Ubuntu---workaround-t4260039.html) detailing problems with scanners and the USB Autosuspend function.

Revision history for this message
Kansei (clauretano) wrote :

It would still be nice for those of us who never attach USB printers or scanners to be able to implement this.

so where is the correct place?

Revision history for this message
Evan Goers (megatog615) wrote :

Maybe the Ubuntu devs knew about this problem and decided to disable it in the kernel?

Revision history for this message
Matthew Garrett (mjg59) wrote :

The powertop output is only relevant if the kernel has these drivers built in - we supply them as modules, so powertop should be fixed to provide more accurate information.

Changed in linux-source-2.6.22:
status: New → Invalid
Revision history for this message
Michael Adams (madams) wrote :

On my Feisty router Dell PIII-1ghz with custom 2.6.22 kernel, the following commands appear to work based on suggestions from PowerTOP 1.8: I've added them to my /etc/init.d/rc.local.

echo 10 >/sys/bus/usb/devices/usb1/power/autosuspend
echo auto >/sys/bus/usb/devices/usb1/power/level

The commands are modified from a thread I found on the USB autosuspend (which were posted as commands to use with a .23 kernel).

http://www.gossamer-threads.com/lists/linux/kernel/822889

Revision history for this message
midnightflash (midnightflash) wrote :

"echo 10 >/sys/bus/usb/devices/usb1/power/autosuspend
echo auto >/sys/bus/usb/devices/usb1/power/level"
I added this too for every USB-port... but is doing nothing.

Revision history for this message
Edwin Zeng (zyangxue) wrote :

I saw the other way: add below line into /etc/modprobe.d/options
            options usbcore autosuspend=1
( Xubuntu 7.10 in my IBM T40, work perpectly)

Revision history for this message
midnightflash (midnightflash) wrote :

It's not working for me...
Still getting the message in PowerTop.
Ubuntu 7.10 - IBM R40 2722-3GG

Revision history for this message
Xvani (fredrile+launchpad) wrote :

No fixes working here either...
Bug confirmed.
Dell D420
Ubuntu 7.10

Revision history for this message
Oleksij Rempel (olerem) wrote :

this is a bug in powertop logic.
ubuntu kernel has usb autosuspend enabled by default, so you do not need any workarounds given here.

Changed in powertop:
status: New → Incomplete
Revision history for this message
midnightflash (midnightflash) wrote :

@ fishor
Are you sure?
As far as I think it WAS enabled by default until 7.04 and IS changed to disabled by default from 7.10.

Revision history for this message
Oleksij Rempel (olerem) wrote : Re: [Bug 136549] Re: Powertop suggest to add usbcore.autosuspend=1 to grub's kernel line, doesn't work

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

:~$ grep CONFIG_USB_SUSPEND /boot/config-2.6.22-14-generic
CONFIG_USB_SUSPEND=y

:~$ cat /sys/module/usbcore/parameters/autosuspend
2

:~$ cat /sys/bus/usb/devices/*/power/autosuspend
0
2
2
2
2
2

yes. it is enabled.

midnightflash schrieb:
> @ fishor
> Are you sure?
> As far as I think it WAS enabled by default until 7.04 and IS changed to disabled by default from 7.10.
>

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHRdQbVVCoNUmKuAcRApvhAJ9Yu+UahxgUjEldEuE6lnM1SQbNBgCfQZap
ZbCeT4+M7Axe2x4SrOezrdA=
=HJQW
-----END PGP SIGNATURE-----

Revision history for this message
schmolch (saschaheid) wrote : Re: Powertop suggest to add usbcore.autosuspend=1 to grub's kernel line, doesn't work

There is something wrong here though.

Before i enable usb autosuspension with powertop my CPU (coreduo) is stuck in C2 75% of the time.
Only after pressing U to enable it the CPU stays in C3 97% of the time and the power-usage drops significantly.

Revision history for this message
Javier Jardón (jjardon) wrote :

See http://www.bughost.org/pipermail/power/2007-September/000992.html

Alan Jenkins wrote:
> Perhaps you have usbcore installed as a module? (CONFIG_USB=m). You can find
> out by checking for it in the output from lsmod. In that case you would want
> to change the modprobe configuration file, um... e.g. add
>
> options usbcore autosuspend=1
>
> to /etc/modprobe.d/options

Revision history for this message
Oleksij Rempel (olerem) wrote :

linux-2.6/Documentation/usb/power-management.txt
        power/autosuspend

                This file contains an integer value, which is the
                number of seconds the device should remain idle before
                the kernel will autosuspend it (the idle-delay time).
                The default is 2. 0 means to autosuspend as soon as
                the device becomes idle, and -1 means never to
                autosuspend. You can write a number to the file to
                change the autosuspend idle-delay time.

Oleksij Rempel (olerem)
Changed in powertop:
status: Incomplete → Confirmed
Oleksij Rempel (olerem)
description: updated
Revision history for this message
Marco Rodrigues (gothicx) wrote : Re: Powertop make wrong suggest to add usbcore.autosuspend=1

Thank you for taking the time to report this bug and helping to make Ubuntu better. However, I am closing it because the bug has been fixed in the latest development version of Ubuntu - the Hardy Heron.

A backport for gutsy has been requested. Let's wait for it... Bug #172607

Changed in powertop:
assignee: nobody → gothicx
status: Confirmed → Fix Released
Revision history for this message
Oleksij Rempel (olerem) wrote :

Sorry. This is wrong fix.

1. This is not fixed upstream.
2. This fix is not according of any usb API documentation:
    - powertop version of logic: if autosuspend is less then 1 display suggestion. ( was made against old API and not correct for new API )
    - debian patch logic: if autosuspend is not 1 display suggestion. ( wrong at all )
    - should be: if autosuspend is negative ( -1, -2 ... ) display suggestion. ( will work for new API but not for old )

Changed in powertop:
importance: Undecided → Low
status: Fix Released → Confirmed
assignee: gothicx → nobody
Changed in powertop:
status: Unknown → Fix Released
Revision history for this message
Daniel Lombraña González (teleyinex) wrote :

Hi,

Today I have found this entry: http://www.blackberryforums.com/linux-users-corner/97661-enable-disable-config_usb_suspend-s-autosuspend-mode.html and there they explain that if your USB devices have a value of 2 the kernel has suspended the usbcore. I have checked which is my default value of my Gutsy kernel and is 2, so powertop is not correctly detecting the state of usbcore, moreover if you check the /sys/bus/usb/devices/*/power/level you will get "auto" which means that the kernel is autosuspending the usb when it's necessary . Additionally it's not suggesting the right value to autosuspend the usb.

Daniel

Revision history for this message
Wouter Stomp (wouterstomp-deactivatedaccount) wrote :

This was correctly fixed in debian in 1.9-2. Needs a sync.

Revision history for this message
schmolch (saschaheid) wrote :

powertop (from svn) tells me that my CPU is stuck in C2 70% of the time until
- i enable usb-autosuspend with powertop
- or remove uhci_hcd myself.
after which C2 drops to zero.

At the same time cat /sys/bus/usb/devices/*/power/level reports AUTO for all values.
No usb-devices are used except for a internal fingerprint reader which is not set up (no modules loaded).
Kernel is 2.6.22-14-generic from Gutsy.

Can anyone explain this please?

Revision history for this message
schmolch (saschaheid) wrote :

0
2
2
2
2
2

are the wrong values, it needs to be

1
1
1
1
1
1

as suggested by powertop.

Its the only way to get the desired result, a SLEEPING Cpu.

Revision history for this message
Greg A (etulfetulf) wrote :

This has been fixed since Ubuntu Hardy.

Changed in powertop:
status: Confirmed → Fix Released
Revision history for this message
JoseLVG (josvazg) wrote :

Then is broken again in Intrepid, at least in the eee kernel flavour.

(eee 901)

Revision history for this message
Oleksij Rempel (olerem) wrote :

It was newer fixed.
IMHO this suggestion should be removed, so nobody will complain about
it. autosuspend is enabled by default in the kernel and any
distribution overwrite this settings.

@Patrick
This is about powertop 1.10
you made notice:
   * Removed usb patch, source has changed completely. hopefully it was
fixed by upstream.
but the patch fix-suggest-usb-autosuspend.dpatch is steal there.

description: updated
Revision history for this message
Dimitrios Symeonidis (azimout) wrote :

this is not fixed!

Changed in powertop:
status: Fix Released → Triaged
Revision history for this message
Dimitrios Symeonidis (azimout) wrote :

I did a little research to find the actual cause of the problem.

There's actually two issues here:

1) powertop suggests to add the usbcore.autosuspend=1 kernel parameter, but we're shipping usbcore as a module (solution described here: https://bugs.launchpad.net/ubuntu/+source/powertop/+bug/136549/comments/16)
this is a confirmed issue, and should be fixed

2) to decide whether to make this suggestion, powertop checks two things:
  a) that /sys/bus/usb/devices/*/power/autosuspend >=0
  b) that /sys/bus/usb/devices/*/power/level != “on”
I have found that in my machine the usb root hubs have power level = "auto", but slave devices (usb mouse, usb storage) have power lever = "on". this causes powertop to make this suggestion.
I am not sure whether powertop is right on this one (i.e. whether the power levels should be auto) or whether the current situation is correct, and powertop should change...

Revision history for this message
hackel (hackel) wrote :

I would like to confirm what Dimitrios said. In my case, I found:
/sys/bus/usb/devices/1-1/power/level = on
This device is my integrated webcam. Now the question is, what is the solution? I can set it to "auto" manually, of course (like in my rc.local), but is there no way to set it as the default for this device? I didn't see a way to set power/level as any module option, especially for a specific device.

Changed in powertop:
status: Fix Released → Unknown
Revision history for this message
Dimitrios Symeonidis (azimout) wrote :

The version included in Jaunty (1.11-1) includes the patch titled "fix-suggest-usb-autosuspend.dpatch
" (see https://edge.launchpad.net/ubuntu/+source/powertop), but the issue still exists, and the diff seems irrelevant (it changes the cdrom polling by hal, see: http://code.google.com/p/powertop/source/detail?r=301)

I am really confused...

Changed in powertop:
status: Unknown → New
Revision history for this message
EricDHH (ericdhh) wrote :

Linux calliope 2.6.28-11-generic #42-Ubuntu SMP Fri Apr 17 01:57:59 UTC 2009 i686 GNU/Linux

cat /home/eric# cat /sys/bus/usb/devices/usb1/power/level auto

ii powertop 1.11-1 Linux tool to find out what is using power

Vorschlag: Aktivieren Sie "USB autosuspend" durch drücken der U-Taste
oder durch Anhängen der Bootoption "usbcore.autosuspend=1" an die Kernel-
kommandozeile oder in der GRUB Konfiguration.

Confirmed, powertop already have this bug.

Bye
Eric

Revision history for this message
Michał Gołębiowski-Owczarek (mgol) wrote :

Still an issue.

Revision history for this message
Michał Gołębiowski-Owczarek (mgol) wrote :

$ uname -a
Linux mgol-laptop 2.6.31-14-generic #48-Ubuntu SMP Fri Oct 16 14:05:01 UTC 2009 x86_64 GNU/Linux

$ cat /sys/bus/usb/devices/usb1/power/level
auto

$ apt-cache policy powertop
  Installed: 1.11-1ubuntu1

Changed in powertop (Debian):
status: New → Fix Released
Revision history for this message
kmsalex (alexmooer26) wrote :

sorry guys, new to lunch pad, added this by mistake, can't figure out how to remove it.

Changed in powertop:
status: New → Invalid
Changed in powertop:
status: Invalid → New
Revision history for this message
Alexander van Loon (avanloon) wrote :

Changed it back to ‘new’ for you. You use the small icons next to the status to change it.

I wonder when this will be fixed? Launchpad claims the bug report on the Debian bug tracker is marked as fixed, so I guess when Ubuntu will synchronize with the Debian package for the next 10.10 release we should get the fix too. But when I read the bug report there I can’t see anywhere whether it’s fixed or not, nor when it would have been fixed.

Revision history for this message
Elias K Gardner (zorkerz) wrote :

I no longer experience this bug. Does anybody else or can we mark it as fixed?

Changed in powertop (Ubuntu):
status: Triaged → Fix Released
Changed in powertop:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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