On 1/9/07, Alan Stern <[EMAIL PROTECTED]> wrote:
> 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?

It has LEDs.

>
> > 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

I tried to unbind/bind with the device in the not working state:
snd-usb-audio 2-1:1.0: usb_probe_interface
snd-usb-audio 2-1:1.0: usb_probe_interface - got id
USB device is in the shutdown state, cannot create a card instance
snd-usb-audio: probe of 2-1:1.0 failed with error -5

Another trace, I toggled sysfs power between 0/2 a couple of times.
Looks like port 2-2 came up but not 2-1 with my device. I didn't do
anything in the 2-2 directory.

usb usb4: finish resume
hub 4-0:1.0: hub_resume
usb usb4: wakeup_rh
hub 4-0:1.0: state 7 ports 2 chg 0000 evt 0000
usb 2-2: usb auto-resume
uhci_hcd 0000:00:1d.1: port 2 portsc 00a5,01
usb 2-2: finish resume
hub 2-2:1.0: hub_resume
hub 2-2:1.0: state 7 ports 4 chg 0000 evt 0000
usb usb4: suspend_rh (auto-stop)
hub 5-1:1.0: hub_suspend
usb 5-1: unlink qh256-0001/f7806100 start 255 [1/0 us]
usb 5-1: usb auto-suspend
hub 4-0:1.0: hub_suspend
usb usb4: suspend_rh
usb usb4: usb auto-suspend
hub 2-2:1.0: hub_suspend
usb 2-2: usb auto-suspend
hub 5-0:1.0: hub_suspend
usb usb5: usb auto-suspend
snd-usb-audio 2-1:1.0: usb_probe_interface
snd-usb-audio 2-1:1.0: usb_probe_interface - got id
USB device is in the shutdown state, cannot create a card instance
snd-usb-audio: probe of 2-1:1.0 failed with error -5
[EMAIL PROTECTED]:/sys/bus/usb/drivers/snd-usb-audio#


-- 
Jon Smirl
[EMAIL PROTECTED]

-------------------------------------------------------------------------
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