Re: Autosuspending devices that seem to need reset_resume

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 9 Jun 2009, Matthew Garrett wrote:

> On Mon, Jun 08, 2009 at 07:47:06PM -0400, Alan Stern wrote:
> > On Mon, 8 Jun 2009, Matthew Garrett wrote:
> > 
> > > If I indicate it needs a reset-resume then it doesn't seem to actually 
> > > be reset unless I add the needs_binding option in the reset_resume 
> > > callback, which strikes me as being absolutely the wrong thing to do.
> > 
> > It sure is.
> > 
> > I don't understand why you don't get a reset.  In driver.c, 
> > usb_resume_device() includes this code:
> > 
> > 	if (udev->quirks & USB_QUIRK_RESET_RESUME)
> > 		udev->reset_resume = 1;
> > 
> > That's why setting the quirk bit in udev should be all you need to do.
> 
> The needs_binding option only seems to be set in the case where 
> USB_QUIRK_RESET_RESUME is present but there's no reset_resume callback 
> in the driver? I don't have enough experience of the USB core to know 
> what that's actually doing.

needs_binding is private to usbcore; it shouldn't be used by drivers.  
It gets set when usbcore has to unbind a driver because the driver
doesn't support suspend, resume, or reset_resume, and then later on it 
causes usbcore to probe for new drivers after the device has been 
resumed or reset.

> > > When system suspend takes place it reboots itself and appears as a 
> > > different USB ID, so there's no hope of restoring state.
> > 
> > In theory, the behavior during a system suspend should be the same as
> > the behavior during an autosuspend.  Which means that after an
> > autoresume, the device should show up with a different USB ID and so
> > the reset would fail.  But that's probably not what's really happening.
> 
> The card comes up in a dumb state and then gets fed 16MB worth of armel 
> ELF object which causes it to reboot into a more useful form. It stays 
> in that state until the power plane is entirely cut, which happens in 
> system suspend but not in autosuspend.

It shouldn't happen in system suspend.  Why doesn't the system provide 
suspend current to the USB bus?

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux