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

Daniel Pittman linux-thinkpad@linux-thinkpad.org
Thu, 30 Oct 2008 11:21:51 +1100


Tino Keitel <tino.keitel@tikei.de> writes:

[...]

> 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

You could much more reliably and cheaply do that as:

    SUBSYSTEMS=="usb", ACTION=="add", ATTR{power/level}="auto"

Note the single '=' in the last ATTR assignment?  That sets the
attribute from inside udev without needing to call out to an external
tool.

> However, it doesn't seem to work 100% reliable, as I still had cases
> where power/level was set to "on".

That works perfectly for me, in terms of setting the power for the
fingerprint reader, which I more exactly match.  I would expect it to be
equally reliable for all USB devices.

Regards,
        Daniel