Re: So, what's the status on the recent patches here?

Alan Stern
2006-08-26T02:21:05Z

On Sat, 26 Aug 2006, Pavel Machek wrote:

> Hi!
>
> > > Are there some patches to test? I'd like to power down USB bus, even
> > > when it has device connected (I do not user fingerprint scanner that
> > > much).
> >
> > There are some old patches. I could update them to the current -mm kernel
> > and post them next week.
>
> Yes, that would be great.
>
> > The idea of the patches is that they will autosuspend a USB hub when it
> > has no active (i.e., unsuspended) children, and autosuspending a root hub
> > stops the USB controller from doing DMA. However, non-hub devices are not
> > yet automatically suspended, so you will have to suspend the fingerprint
> > scanner by hand.
>
> That is okay, I can do that. It saves 2 hours of battery life on my
> machine...

Come to think of it, you don't need the autosuspend patches to turn these
devices off. You can do it right now with your existing kernel, although
it's a little easier with -mm. (The reason is that -mm contains a
development patch which ties a USB device's interfaces to the device
itself; suspending the device will automatically suspend all its
interfaces, and likewise resuming the device will automatically resume all
its interfaces. With a vanilla kernel you must manually suspend the
interfaces before you can suspend the device and manually resume them
after resuming the device.)

Anyway, you can use the deprecated

echo -n 2 >/sys/devices/.../power/state

mechanism to suspend all the USB interfaces, devices, and controllers you
want -- provided you work your way up from the bottom of the device tree.
The autosuspend patch just makes it simpler, since it takes care of
suspending and resuming all the hubs for you.

Alan Stern