Re: [PATCH 6/6] USB: ehci-omap: Implement suspend/resume

2013-07-23 Thread Alan Stern
On Tue, 23 Jul 2013, Roger Quadros wrote: > >> + pm_runtime_get_sync(dev); > >> + ehci_resume(hcd, false); > >> + ret = ehci_suspend(hcd, do_wakeup); > >> + pm_runtime_put_sync(dev); > > > > It would be better to call pm_runtime_resume(dev)

Re: [PATCH 6/6] USB: ehci-omap: Implement suspend/resume

2013-07-23 Thread Roger Quadros
On 07/22/2013 06:18 PM, Alan Stern wrote: > On Mon, 22 Jul 2013, Roger Quadros wrote: > >> Right, I understand it now. How does the below code look? >> >> +static int omap_ehci_suspend(struct device *dev) >> +{ >> + struct usb_hcd *hcd = dev_get_drvdata(dev); >> + bool do_wakeup = devi

Re: [PATCH 6/6] USB: ehci-omap: Implement suspend/resume

2013-07-22 Thread Alan Stern
On Mon, 22 Jul 2013, Roger Quadros wrote: > Right, I understand it now. How does the below code look? > > +static int omap_ehci_suspend(struct device *dev) > +{ > + struct usb_hcd *hcd = dev_get_drvdata(dev); > + bool do_wakeup = device_may_wakeup(dev); > + int ret; > + > +

Re: [PATCH 6/6] USB: ehci-omap: Implement suspend/resume

2013-07-22 Thread Roger Quadros
Hi Alan, On 07/11/2013 06:14 PM, Alan Stern wrote: > On Thu, 11 Jul 2013, Roger Quadros wrote: > >>> The other two problems are both related to the interaction between >>> system PM and runtime PM. Suppose the controller is already runtime >>> suspended when the system goes to sleep. Because it

Re: [PATCH 6/6] USB: ehci-omap: Implement suspend/resume

2013-07-11 Thread Alan Stern
On Thu, 11 Jul 2013, Roger Quadros wrote: > > The other two problems are both related to the interaction between > > system PM and runtime PM. Suppose the controller is already runtime > > suspended when the system goes to sleep. Because it is runtime > > suspended, it is enabled for wakeup. Bu

Re: [PATCH 6/6] USB: ehci-omap: Implement suspend/resume

2013-07-11 Thread Roger Quadros
On 07/10/2013 10:04 PM, Alan Stern wrote: > On Wed, 10 Jul 2013, Roger Quadros wrote: > >> Call ehci_suspend/resume() during runtime suspend/resume >> as well as system suspend/resume. >> >> Use a flag "bound" to indicate that the HCD structures are valid. >> This is only true between usb_add_hcd(

Re: [PATCH 6/6] USB: ehci-omap: Implement suspend/resume

2013-07-10 Thread Alan Stern
On Wed, 10 Jul 2013, Roger Quadros wrote: > Call ehci_suspend/resume() during runtime suspend/resume > as well as system suspend/resume. > > Use a flag "bound" to indicate that the HCD structures are valid. > This is only true between usb_add_hcd() and usb_remove_hcd() calls. > > The flag can be

[PATCH 6/6] USB: ehci-omap: Implement suspend/resume

2013-07-10 Thread Roger Quadros
Call ehci_suspend/resume() during runtime suspend/resume as well as system suspend/resume. Use a flag "bound" to indicate that the HCD structures are valid. This is only true between usb_add_hcd() and usb_remove_hcd() calls. The flag can be used by omap_ehci_runtime_suspend/resume() handlers to a