On Thu, 11 May 2006, David Brownell wrote:

> On Thursday 11 May 2006 10:07 am, Alan Stern wrote:
> > Please reply to the mailing list as well as to me.
> > 
> > On Thu, 11 May 2006, rakesh kn wrote:
> > 
> > > Hi,
> > > In the suspend/resume call back in platform driver structure, i am
> > > exactly doing the same,
> > > i call bus_suspend to suspend all the ports in the controller. and the
> > > i halt the controller.
> > > This is what is done in the suspend call back.
> > > 
> > > Then which function/call back is invoked when we try to suspend/resume
> > > from the /sys/bus/usb/devices/usb1/power/state .
> > 
> > Writing to that file doesn't invoke anything. 
> 
> Not so.  That's the device representing the root hub (representing all
> the downstream usb links), as distinct from the interface for the root hub
> (used to control individual downstream links) or the host controller (for
> the upstream links, such as PCI or some other bus).

Let's be more precise.

Writing a positive value to /sys/bus/usb/devices/usb1/power/state will
invoke usb_generic_suspend() in drivers/usb/core/usb.c.  That routine will
call usb_suspend_device() in drivers/usb/core/hub.c.  If
CONFIG_USB_SUSPEND isn't set, that routine will return without calling
anything else.  If CONFIG_USB_SUSPEND _is_ set, that routine will call 
__usb_suspend_device() in drivers/usb/core/hub.c.  Then that routine will 
return without calling anything else.

Either way, none of the suspend routines in the host controller driver 
will be invoked.

A similar analysis applies when you write a 0 to /sys/.../power/state,
although it differs because usbcore will automatically resume the root hub
interface.  So it will call hub_resume() in drivers/usb/core/hub.c, which
will call hcd_bus_resume() in drivers/usb/core/hcd.c, which will call
hcd->driver->bus_resume().
 
So for resuming, one of the host controller driver's resume routines does
get invoked.

Alan Stern



-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
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