# Reduce wakeups from USB2.0-CRW [Solved]

## ppurka

Update [Solution]: https://forums.gentoo.org/viewtopic-p-6749142.html#6749142

I am trying to reduce the wakeups from the following device, but I don't know how to. Let me give some info first.

```
~> lsusb

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Bus 001 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub

Bus 002 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub

Bus 001 Device 003: ID 0489:e00d Foxconn / Hon Hai 

Bus 002 Device 004: ID 046d:c526 Logitech, Inc. Nano Receiver

Bus 002 Device 005: ID 5986:0195 Acer, Inc 

Bus 002 Device 006: ID 0bda:0158 Realtek Semiconductor Corp. USB 2.0 multicard reader

```

Output of powertop -d:

```
~> sudo powertop -d

PowerTOP 1.13   (C) 2007 - 2010 Intel Corporation 

Collecting data for 15 seconds 

Cn             Avg residency

C0 (cpu running)        ( 0.9%)

polling        0.5ms ( 0.0%)

C1 mwait     0.1ms ( 0.0%)

C2 mwait     1.9ms ( 8.4%)

C3 mwait     4.0ms (90.7%)

P-states (frequencies)

  2.54 Ghz     0.1%

  2.14 Ghz     0.3%

  2.00 Ghz     0.2%

  1.74 Ghz     0.2%

  1199 Mhz    98.5%

Wakeups-from-idle per second : 272.9   interval: 15.0s

no ACPI power usage estimate available

Top causes for wakeups:

  25.6% ( 78.0)   vqueue:src

  15.4% ( 47.1)   [hda_intel] <interrupt>

  13.9% ( 42.5)   java

   9.6% ( 29.4)   [ehci_hcd:usb1, nvidia] <interrupt>

   6.5% ( 19.7)   source:src

   4.1% ( 12.7)   kworker/0:1

   4.1% ( 12.4)   [eth1, hda_intel] <interrupt>

   3.8% ( 11.7)   opera

   2.6% (  8.0)   USB device 2-1.6 : USB2.0-CRW (Generic)

   2.6% (  7.9)   [ehci_hcd:usb2] <interrupt>

   2.5% (  7.5)   thunderbird-bin

   1.6% (  5.0)   [ahci] <interrupt>

   1.6% (  5.0)   syndaemon

   1.5% (  4.6)   kworker/0:0

   1.2% (  3.8)   gmusicbrowser

   1.1% (  3.3)   enlightenment

   0.9% (  2.6)   [Function call interrupts] <kernel IPI>

   0.4% (  1.3)   [Rescheduling interrupts] <kernel IPI>

   0.2% (  0.5)   udisks-daemon

   0.1% (  0.2)   [acpi] <interrupt>

   0.1% (  0.2)   pidgin

   0.1% (  0.2)   operapluginclea

   0.1% (  0.2)   kded4

   0.1% (  0.2)   init

   0.0% (  0.1)   [kernel core] inet_twdr_hangman (inet_twdr_hangman)

   0.0% (  0.1)   NetworkManager

   0.0% (  0.1)   flush-8:0

   0.0% (  0.1)   operapluginwrap

   0.0% (  0.1)   ips-adjust

   0.0% (  0.1)   urxvtd

   0.0% (  0.1)   enable_composit

   0.0% (  0.1)   [kernel core] neigh_timer_handler (neigh_timer_handler)

   0.0% (  0.1)   kworker/0:3

   0.0% (  0.1)   wpa_supplicant

   0.0% (  0.1)   kworker/3:2

   0.0% (  0.1)   upowerd

An audio device is active 100.0% of the time:

hwC0D1 Conexant CX20585 

A USB device is active 100.0% of the time:

/sys/bus/usb/devices/2-1

Suggestion: Enable the CONFIG_INOTIFY kernel configuration option.

This option allows programs to wait for changes in files and directories

instead of having to poll for these changes

Recent USB suspend statistics

Active  Device name

100.0%   USB device 2-1.6 : USB2.0-CRW (Generic)

  0.0%   USB device 2-1.3 : Lenovo EasyCamera (Bison Corp.)

  0.0%   USB device 2-1.2 : USB Receiver (Logitech)

  0.0%   USB device 1-1.4 : Broadcom Bluetooth 2.1 Device (Broadcom Corp)

100.0%   /sys/bus/usb/devices/2-1

  0.0%   /sys/bus/usb/devices/1-1

100.0%   USB device usb2 : EHCI Host Controller (Linux 2.6.38-gentoo-r3 ehci_hcd)

  0.0%   USB device usb1 : EHCI Host Controller (Linux 2.6.38-gentoo-r3 ehci_hcd)

Runtime Device Power Management statistics

Active  Device name

100.0%   06:00.0 Network controller: Broadcom Corporation Device 4727 

100.0%   01:00.1 Audio device: nVidia Corporation High Definition Audio Controller 

100.0%   01:00.0 VGA compatible controller: nVidia Corporation Device 0a70 

100.0%   00:1f.6 Signal processing controller: Intel Corporation 5 Series/3400 Series Chipset Thermal Subsystem 

100.0%   00:1f.2 SATA controller: Intel Corporation 5 Series/3400 Series Chipset 4 port SATA AHCI Controller 

100.0%   00:1d.0 USB Controller: Intel Corporation 5 Series/3400 Series Chipset USB2 Enhanced Host Controller 

100.0%   00:1c.4 PCI bridge: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 5 

100.0%   00:1c.2 PCI bridge: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 3 

100.0%   00:1c.1 PCI bridge: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 2 

100.0%   00:1c.0 PCI bridge: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 1 

100.0%   00:1b.0 Audio device: Intel Corporation 5 Series/3400 Series Chipset High Definition Audio 

  0.0%   00:1a.0 USB Controller: Intel Corporation 5 Series/3400 Series Chipset USB2 Enhanced Host Controller 

100.0%   00:01.0 PCI bridge: Intel Corporation Core Processor PCI Express x16 Root Port 

Devices without runtime PM

ff:02.3 Host bridge: Intel Corporation Core Processor Reserved 

ff:02.2 Host bridge: Intel Corporation Core Processor Reserved 

ff:02.1 Host bridge: Intel Corporation Core Processor QPI Physical 0 

ff:02.0 Host bridge: Intel Corporation Core Processor QPI Link 0 

ff:00.1 Host bridge: Intel Corporation Core Processor QuickPath Architecture System Address Decoder 

ff:00.0 Host bridge: Intel Corporation Core Processor QuickPath Architecture Generic Non-core Registers 

07:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8101E/RTL8102E PCI Express Fast Ethernet controller 

00:1f.3 SMBus: Intel Corporation 5 Series/3400 Series Chipset SMBus Controller 

00:1f.0 ISA bridge: Intel Corporation Mobile 5 Series Chipset LPC Interface Controller 

00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge 

00:16.0 Communication controller: Intel Corporation 5 Series/3400 Series Chipset HECI Controller 

00:00.0 Host bridge: Intel Corporation Core Processor DRAM Controller 

Recent audio activity statistics

Active  Device name

100.0%   hwC0D1 Conexant CX20585 

Recent SATA AHCI link activity statistics

Active   Partial   Slumber   Device name
```

As you can see from the above output, the MMC/SD card reader is always at 100% usage even though I have no sd card plugged in.  My question is, how do I reduce the wakeups from this device? Unloading ehci module is not an option since it would make any plugged in usb drive extremely slow.

The "java" that shows up is actually davmail. I looked through the davmail code and didn't see any "sleep" command which could induce such high wakeups. My conclusion is that it is the behemoth java which is at fault here.

Finally, neglect the audio since i am playing some music right now through gmusicbrowser. gmusicbrowser itself seems pretty decent.

----------

## kernelOfTruth

```
echo 1 > /sys/bus/usb/devices/2-1/remove
```

 :Very Happy: 

if that's not the exact path or the "remove" entry is not available you need to compile the support into the kernel

I've been having this issue with my cardreader for a long time and stumbled over the solution after some days (or weeks) of searching on the net

----------

## ppurka

This effectively disabled an entire usb subsystem for me. And my external mouse stopped working.

----------

## kernelOfTruth

 *ppurka wrote:*   

> This effectively disabled an entire usb subsystem for me. And my external mouse stopped working.

 

sorry  :Sad: 

for me it's an cardreader with USB-ports

and the ports still work

since I don't use the cardreader so often I didn't notice that it (probably) wouldn't work anymore

you could try playing around with the autosuspend & suspend features of usb

but afaik this didn't help me with it in the past

if I remember correctly "remove" was the only solution to stop these annoying ticks for me

you have a desktop environment such as gnome with hal or udisks running ?

several months ago I made the observation that these ticks didn't happen when I was on blackbox or fluxbox

so something in these DEs must be polling it (hal, dbus, etc.)

perhaps excluding it from these (via rule) would help

----------

## ppurka

Thanks for your help! I have instead figured out that I can "echo 1 > remove" inside the directory 

/sys/bus/usb/devices/2-1.6/power. This removes the card reader but keeps my mouse intact. And stops the wakeups from happening.

This is only a partial solution for me, since the card reader is now completely deactivated and useless once I run the above command. It seems like it is some generic and quite pathetic card reader since I wasn't able to change it's state to enable power management even by echo-ing various stuff to the other files inside the power/ directory.

----------

## ppurka

Finally, I have found the solution. Force PCIE power management. http://lwn.net/Articles/449068/

One needs to append pcie_aspm=force to the kernel command line.

----------

## kernelOfTruth

ha !

awesome find  :Smile: 

due to the article at phoronix.com I also had set that but didn't look if it made a change with the cardreader

will see if it still shows that stupid behavior when not removing it via command

Thanks !

----------

## ppurka

What alerted me was a line in dmesg that said 

```
ACPI FADT declares the system doesn't support PCIe ASPM, so disable it
```

My battery life literally just doubled after forcing that setting. Number of wakeups hover around 15-20 on an idle (e17) desktop with a browser open, terminal open, gvim open.

----------

