On Tue, 9 Jan 2007, Jon Smirl wrote:

> On 1/9/07, Alan Stern <[EMAIL PROTECTED]> wrote:
> > On Tue, 9 Jan 2007, Jon Smirl wrote:
> >
> > > Is there some tool or sys variable that can toggle power to the
> > > device? That will let me see if it is in sleep mode when it shouldn't
> > > be.
> >
> > If you turn on CONFIG_PM_SYSFS_DEPRECATED then you can suspend your device
> > by doing:
> >
> >         echo -n 2 >/sys/bus/usb/devices/.../power/state
> >
> > and resume it by writing a '0' instead of a '2'.  The value in that file
> > will tell you the device's current state.
>
> My sound device is failing to power-on 9/10 times so if you have a
> patch that might fix this I can test it. I'm running the current Linus
> tree.

I can't fix the failure to power-on because I don't know what the cause 
is.  If all you want to do is prevent the automatic 
suspend-after-2-seconds, turn off CONFIG_USB_SUSPEND.

> When I booted and the device was in a non-working state, state was 0.
> So the driver thinks it is active when the device isn't.

No.  The kernel thinks the device is active (not suspended) and the 
device isn't working.  There's a difference: active != working.

> I tried writing 0 & 2 to state multiple times but I can't get the
> device to power on.

How can you tell whether the device is powered on or not?  Does it have an 
LED indicator or something like that?

> This message was interesting:
> snd-usb-audio 2-1:1.0: no resume for driver snd-usb-audio?

That certainly could lead to problems with the test I suggested.  But it 
shouldn't affect what happens during boot-up, because the device gets 
resumed before snd-usb-audio is bound to it.

For some other post-boot tests, you might want to unbind snd-usb-audio
(which would automatically cause the device to suspend after two seconds)
and then rebind it (which would automatically resume the device first).

To unbind and rebind:

        cd /sys/bus/usb/drivers/snd-usb-audio
        echo -n 2-1:1.0 >unbind
        sleep 5         # Wait for automatic suspend
        echo -n 2-1:1.0 >bind

Alan Stern


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to