From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757399AbbGGO2y (ORCPT ); Tue, 7 Jul 2015 10:28:54 -0400 Received: from iolanthe.rowland.org ([192.131.102.54]:33345 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S932280AbbGGO2g (ORCPT ); Tue, 7 Jul 2015 10:28:36 -0400 Date: Tue, 7 Jul 2015 10:28:34 -0400 (EDT) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Felipe Balbi cc: Douglas Anderson , Greg Kroah-Hartman , John Youn , , Chris Zhong , Heiko Stuebner , Julius Werner , Andrew Bresticker , Alexandru Stan , , , Subject: Re: [REPOST PATCH 3/3] USB: dwc2: Don't turn off the usbphy in suspend if wakeup is enabled In-Reply-To: <20150706190212.GN20779@saruman.tx.rr.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 request. > > > > I don't know if implementing this in other HCDs would save any power. > > Any ideas? > > most likely it would. Enabling wakeup usually boils down to keeping a > tiny part of the controller (or PHY) powered up. Sometimes that lies in > an always-on power domain, so there would be no difference. 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. The idea is that a host controller driver can do something like this: do_wakeup = device_may_wakeup(...); if (usb_hcd_wakeup_not_needed(hcd)) do_wakeup = false; It encapsulates what you want in a form that can easily be used by every HCD. We can then add this call into the HCDs, over time. (Merging a change like this would be a challenge. I guess Felipe would have to put it in a separate branch which Greg could pull, or vice versa, so that the new routine would be available to patches submitted to either maintainer.) Alan Stern From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alan Stern Subject: Re: [REPOST PATCH 3/3] USB: dwc2: Don't turn off the usbphy in suspend if wakeup is enabled Date: Tue, 7 Jul 2015 10:28:34 -0400 (EDT) Message-ID: References: <20150706190212.GN20779@saruman.tx.rr.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20150706190212.GN20779-HgARHv6XitJaoMGHk7MhZQC/G2K4zDHf@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+glpar-linux-rockchip=m.gmane.org-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org To: Felipe Balbi Cc: Heiko Stuebner , linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, John Youn , Greg Kroah-Hartman , linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Douglas Anderson , linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Andrew Bresticker , lyz-TNX95d0MmH7DzftRWevZcw@public.gmane.org, Chris Zhong , Julius Werner , Alexandru Stan List-Id: linux-rockchip.vger.kernel.org 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 request. > > > > I don't know if implementing this in other HCDs would save any power. > > Any ideas? > > most likely it would. Enabling wakeup usually boils down to keeping a > tiny part of the controller (or PHY) powered up. Sometimes that lies in > an always-on power domain, so there would be no difference. 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. The idea is that a host controller driver can do something like this: do_wakeup = device_may_wakeup(...); if (usb_hcd_wakeup_not_needed(hcd)) do_wakeup = false; It encapsulates what you want in a form that can easily be used by every HCD. We can then add this call into the HCDs, over time. (Merging a change like this would be a challenge. I guess Felipe would have to put it in a separate branch which Greg could pull, or vice versa, so that the new routine would be available to patches submitted to either maintainer.) Alan Stern