Re: [REPOST PATCH 3/3] USB: dwc2: Don't turn off the usbphy in suspend if wakeup is enabled

2015-07-08 Thread Alan Stern
On Wed, 8 Jul 2015, Julius Werner wrote: > > But I don't see how you will make it work when the root hub itself is > > not enabled for wakeup and a non-hub device plugged into one of the > > root hub's ports is enabled. > > > > It seems like you would need a usb_hcd_wakeup_not_needed(hcd, port) >

Re: [REPOST PATCH 3/3] USB: dwc2: Don't turn off the usbphy in suspend if wakeup is enabled

2015-07-08 Thread Julius Werner
> But I don't see how you will make it work when the root hub itself is > not enabled for wakeup and a non-hub device plugged into one of the > root hub's ports is enabled. > > It seems like you would need a usb_hcd_wakeup_not_needed(hcd, port) > subroutine. We'd just put that in the Tegra

Re: [REPOST PATCH 3/3] USB: dwc2: Don't turn off the usbphy in suspend if wakeup is enabled

2015-07-08 Thread Alan Stern
On Tue, 7 Jul 2015, Julius Werner wrote: > > Doug, how would you feel about reworking the patch that exports > > usb_wakeup_enabled_descendants()? Instead of doing it that way, create > > and export a new subroutine in hcd.c called > > usb_hcd_wakeup_not_needed(), or something similar. > > We

Re: [REPOST PATCH 3/3] USB: dwc2: Don't turn off the usbphy in suspend if wakeup is enabled

2015-07-08 Thread Alan Stern
On Tue, 7 Jul 2015, Julius Werner wrote: Doug, how would you feel about reworking the patch that exports usb_wakeup_enabled_descendants()? Instead of doing it that way, create and export a new subroutine in hcd.c called usb_hcd_wakeup_not_needed(), or something similar. We have a use

Re: [REPOST PATCH 3/3] USB: dwc2: Don't turn off the usbphy in suspend if wakeup is enabled

2015-07-08 Thread Julius Werner
But I don't see how you will make it work when the root hub itself is not enabled for wakeup and a non-hub device plugged into one of the root hub's ports is enabled. It seems like you would need a usb_hcd_wakeup_not_needed(hcd, port) subroutine. We'd just put that in the Tegra platform

Re: [REPOST PATCH 3/3] USB: dwc2: Don't turn off the usbphy in suspend if wakeup is enabled

2015-07-08 Thread Alan Stern
On Wed, 8 Jul 2015, Julius Werner wrote: But I don't see how you will make it work when the root hub itself is not enabled for wakeup and a non-hub device plugged into one of the root hub's ports is enabled. It seems like you would need a usb_hcd_wakeup_not_needed(hcd, port)

Re: [REPOST PATCH 3/3] USB: dwc2: Don't turn off the usbphy in suspend if wakeup is enabled

2015-07-07 Thread Julius Werner
> Doug, how would you feel about reworking the patch that exports > usb_wakeup_enabled_descendants()? Instead of doing it that way, create > and export a new subroutine in hcd.c called > usb_hcd_wakeup_not_needed(), or something similar. We have a use case with another host controller (Tegra,

Re: [REPOST PATCH 3/3] USB: dwc2: Don't turn off the usbphy in suspend if wakeup is enabled

2015-07-07 Thread Alan Stern
On Mon, 6 Jul 2015, Felipe Balbi wrote: > > You know, this is the first time I've run across this optimization. > > > > In principle it applies to any USB host controller, not just to PHYs. > > There's no reason to enable wakeup for a controller if none of the > > attached devices can issue a

Re: [REPOST PATCH 3/3] USB: dwc2: Don't turn off the usbphy in suspend if wakeup is enabled

2015-07-07 Thread Julius Werner
Doug, how would you feel about reworking the patch that exports usb_wakeup_enabled_descendants()? Instead of doing it that way, create and export a new subroutine in hcd.c called usb_hcd_wakeup_not_needed(), or something similar. We have a use case with another host controller (Tegra, which

Re: [REPOST PATCH 3/3] USB: dwc2: Don't turn off the usbphy in suspend if wakeup is enabled

2015-07-07 Thread Alan Stern
On Mon, 6 Jul 2015, Felipe Balbi wrote: You know, this is the first time I've run across this optimization. In principle it applies to any USB host controller, not just to PHYs. There's no reason to enable wakeup for a controller if none of the attached devices can issue a wakeup

Re: [REPOST PATCH 3/3] USB: dwc2: Don't turn off the usbphy in suspend if wakeup is enabled

2015-07-06 Thread Doug Anderson
Hi, On Mon, Jul 6, 2015 at 12:02 PM, Felipe Balbi wrote: > On Mon, Jul 06, 2015 at 02:58:16PM -0400, Alan Stern wrote: >> On Mon, 6 Jul 2015, Douglas Anderson wrote: >> >> > If the 'snps,need-phy-for-wake' is set in the device tree then: >> > >> > - We know that we can wakeup, so call

Re: [REPOST PATCH 3/3] USB: dwc2: Don't turn off the usbphy in suspend if wakeup is enabled

2015-07-06 Thread Felipe Balbi
On Mon, Jul 06, 2015 at 12:32:56PM -0700, Doug Anderson wrote: > Felipe, > > On Mon, Jul 6, 2015 at 11:34 AM, Felipe Balbi wrote: > > Hi, > > > > On Mon, Jul 06, 2015 at 11:27:04AM -0700, Douglas Anderson wrote: > >> @@ -282,6 +296,28 @@ static int dwc2_driver_probe(struct platform_device > >>

Re: [REPOST PATCH 3/3] USB: dwc2: Don't turn off the usbphy in suspend if wakeup is enabled

2015-07-06 Thread Doug Anderson
Felipe, On Mon, Jul 6, 2015 at 11:34 AM, Felipe Balbi wrote: > Hi, > > On Mon, Jul 06, 2015 at 11:27:04AM -0700, Douglas Anderson wrote: >> @@ -282,6 +296,28 @@ static int dwc2_driver_probe(struct platform_device >> *dev) >> return retval; >> } >> >> +static bool __maybe_unused

Re: [REPOST PATCH 3/3] USB: dwc2: Don't turn off the usbphy in suspend if wakeup is enabled

2015-07-06 Thread Felipe Balbi
On Mon, Jul 06, 2015 at 02:58:16PM -0400, Alan Stern wrote: > On Mon, 6 Jul 2015, Douglas Anderson wrote: > > > If the 'snps,need-phy-for-wake' is set in the device tree then: > > > > - We know that we can wakeup, so call device_set_wakeup_capable(). > > The USB core will use this knowledge to

Re: [REPOST PATCH 3/3] USB: dwc2: Don't turn off the usbphy in suspend if wakeup is enabled

2015-07-06 Thread Alan Stern
On Mon, 6 Jul 2015, Douglas Anderson wrote: > If the 'snps,need-phy-for-wake' is set in the device tree then: > > - We know that we can wakeup, so call device_set_wakeup_capable(). > The USB core will use this knowledge to enable wakeup by default. > - We know that we should keep the PHY on

Re: [REPOST PATCH 3/3] USB: dwc2: Don't turn off the usbphy in suspend if wakeup is enabled

2015-07-06 Thread Felipe Balbi
Hi, On Mon, Jul 06, 2015 at 11:27:04AM -0700, Douglas Anderson wrote: > @@ -282,6 +296,28 @@ static int dwc2_driver_probe(struct platform_device *dev) > return retval; > } > > +static bool __maybe_unused dwc2_can_poweroff_phy(struct dwc2_hsotg *dwc2) > +{ > + struct usb_device

[REPOST PATCH 3/3] USB: dwc2: Don't turn off the usbphy in suspend if wakeup is enabled

2015-07-06 Thread Douglas Anderson
If the 'snps,need-phy-for-wake' is set in the device tree then: - We know that we can wakeup, so call device_set_wakeup_capable(). The USB core will use this knowledge to enable wakeup by default. - We know that we should keep the PHY on during suspend if something on our root hub needs

[REPOST PATCH 3/3] USB: dwc2: Don't turn off the usbphy in suspend if wakeup is enabled

2015-07-06 Thread Douglas Anderson
If the 'snps,need-phy-for-wake' is set in the device tree then: - We know that we can wakeup, so call device_set_wakeup_capable(). The USB core will use this knowledge to enable wakeup by default. - We know that we should keep the PHY on during suspend if something on our root hub needs

Re: [REPOST PATCH 3/3] USB: dwc2: Don't turn off the usbphy in suspend if wakeup is enabled

2015-07-06 Thread Felipe Balbi
Hi, On Mon, Jul 06, 2015 at 11:27:04AM -0700, Douglas Anderson wrote: @@ -282,6 +296,28 @@ static int dwc2_driver_probe(struct platform_device *dev) return retval; } +static bool __maybe_unused dwc2_can_poweroff_phy(struct dwc2_hsotg *dwc2) +{ + struct usb_device *root_hub =

Re: [REPOST PATCH 3/3] USB: dwc2: Don't turn off the usbphy in suspend if wakeup is enabled

2015-07-06 Thread Alan Stern
On Mon, 6 Jul 2015, Douglas Anderson wrote: If the 'snps,need-phy-for-wake' is set in the device tree then: - We know that we can wakeup, so call device_set_wakeup_capable(). The USB core will use this knowledge to enable wakeup by default. - We know that we should keep the PHY on during

Re: [REPOST PATCH 3/3] USB: dwc2: Don't turn off the usbphy in suspend if wakeup is enabled

2015-07-06 Thread Doug Anderson
Felipe, On Mon, Jul 6, 2015 at 11:34 AM, Felipe Balbi ba...@ti.com wrote: Hi, On Mon, Jul 06, 2015 at 11:27:04AM -0700, Douglas Anderson wrote: @@ -282,6 +296,28 @@ static int dwc2_driver_probe(struct platform_device *dev) return retval; } +static bool __maybe_unused

Re: [REPOST PATCH 3/3] USB: dwc2: Don't turn off the usbphy in suspend if wakeup is enabled

2015-07-06 Thread Felipe Balbi
On Mon, Jul 06, 2015 at 02:58:16PM -0400, Alan Stern wrote: On Mon, 6 Jul 2015, Douglas Anderson wrote: If the 'snps,need-phy-for-wake' is set in the device tree then: - We know that we can wakeup, so call device_set_wakeup_capable(). The USB core will use this knowledge to enable

Re: [REPOST PATCH 3/3] USB: dwc2: Don't turn off the usbphy in suspend if wakeup is enabled

2015-07-06 Thread Felipe Balbi
On Mon, Jul 06, 2015 at 12:32:56PM -0700, Doug Anderson wrote: Felipe, On Mon, Jul 6, 2015 at 11:34 AM, Felipe Balbi ba...@ti.com wrote: Hi, On Mon, Jul 06, 2015 at 11:27:04AM -0700, Douglas Anderson wrote: @@ -282,6 +296,28 @@ static int dwc2_driver_probe(struct platform_device

Re: [REPOST PATCH 3/3] USB: dwc2: Don't turn off the usbphy in suspend if wakeup is enabled

2015-07-06 Thread Doug Anderson
Hi, On Mon, Jul 6, 2015 at 12:02 PM, Felipe Balbi ba...@ti.com wrote: On Mon, Jul 06, 2015 at 02:58:16PM -0400, Alan Stern wrote: On Mon, 6 Jul 2015, Douglas Anderson wrote: If the 'snps,need-phy-for-wake' is set in the device tree then: - We know that we can wakeup, so call