Hi, On Tue, Sep 02, 2014 at 05:19:18PM +0530, Kiran Kumar Raparthy wrote: > From: Todd Poynor <toddpoy...@google.com> > > usb: phy: Temporarily hold wakeupsource on charger connect and disconnect > events > > Allow other parts of the system to react to the charger connect/disconnect > event without allowing the system to suspend before the other parts can > process > the event. This wakeup_source times out after 2 seconds; if nobody else holds > a > wakeup_source by that time then the device can sleep. > > Cc: Felipe Balbi <ba...@ti.com> > Cc: Greg Kroah-Hartman <gre...@linuxfoundation.org> > Cc: linux-ker...@vger.kernel.org > Cc: linux-usb@vger.kernel.org > Cc: Android Kernel Team <kernel-t...@android.com> > Cc: John Stultz <john.stu...@linaro.org> > Signed-off-by: Todd Poynor <toddpoy...@google.com> > [kiran: Added context to commit message > wakeupsource handling implemented per PHY in phy core] > Signed-off-by: Kiran Raparthy <kiran.ku...@linaro.org> > --- > drivers/usb/phy/otg-wakeupsource.c | 2 +- > drivers/usb/phy/phy.c | 10 ++++++++++ > include/linux/usb/phy.h | 3 +++ > 3 files changed, 14 insertions(+), 1 deletion(-) > > diff --git a/drivers/usb/phy/otg-wakeupsource.c > b/drivers/usb/phy/otg-wakeupsource.c > index fca2010..70fa05e 100644 > --- a/drivers/usb/phy/otg-wakeupsource.c > +++ b/drivers/usb/phy/otg-wakeupsource.c > @@ -48,7 +48,7 @@ static void otgws_handle_event(struct usb_phy *otgws_xceiv, > unsigned long event) > case USB_EVENT_NONE: > case USB_EVENT_ID: > case USB_EVENT_CHARGER: > - usb_drop_wsource(otgws_xceiv); > + usb_temporary_hold_wsource(otgws_xceiv);
looks like this won't work. You're holding the lock even on USB_EVEN_NONE. Why ? -- balbi
signature.asc
Description: Digital signature