[ltp] 100% activity from fingerprint reader even with usbcore.autosuspend=1?

Tino Keitel linux-thinkpad@linux-thinkpad.org
Wed, 29 Oct 2008 09:48:38 +0100


On Wed, Oct 29, 2008 at 09:14:27 +0100, Tino Keitel wrote:
> On Wed, Oct 29, 2008 at 08:39:30 +0100, Yves-Alexis Perez wrote:
> > Hi,
> > 
> > I've enabled usbcore.autosuspend=1 in my command line, and it seems to
> > be applied:
> > 
> > corsac@hidalgo: grep . /sys/bus/usb/devices/*/power/autosuspend
> > /sys/bus/usb/devices/1-2/power/autosuspend:1
> > /sys/bus/usb/devices/usb1/power/autosuspend:1
> > /sys/bus/usb/devices/usb2/power/autosuspend:1
> > /sys/bus/usb/devices/usb3/power/autosuspend:1
> > /sys/bus/usb/devices/usb4/power/autosuspend:1
> > /sys/bus/usb/devices/usb5/power/autosuspend:1
> > /sys/bus/usb/devices/usb6/power/autosuspend:1
> > /sys/bus/usb/devices/usb7/power/autosuspend:1
> > 
> > But it seems the fingerprint reader doesn't care:
> > 
> > Recent USB suspend statistics
> > Active  Device name
> > 100,0%	USB device  1-2 : Biometric Coprocessor (STMicroelectronics)
> 
> What does this look like?
> 
> grep "" /sys/bus/usb/devices/*/power/level

To elaborate (from my understanding): autosuspend only tells the device
that it may suspend if it needs to. The device may still decide to not
do that and stay active (leave power/level at "on"). That's why I wrote
this udev rule:

SUBSYSTEM=="usb", ACTION=="add", RUN+="/lib/udev/usb-enable-autosuspend"

This is the /lib/udev/usb-enable-autosuspend script:

#!/bin/sh

if test -f /sys/$DEVPATH/power/level ; then
        echo "auto" > /sys/$DEVPATH/power/level
fi

However, it doesn't seem to work 100% reliable, as I still had cases
where power/level was set to "on". Maybe something changed that after
the udev add event.

Regards,
Tino