Date: Wed, 16 Mar 2005 14:46:09 +0100 From: Colin Leroy To: David Brownell Cc: linux-usb-devel@lists.sourceforge.net, debian-powerpc@lists.debian.org, Benjamin Herrenschmidt , Greg KH Subject: Re: [linux-usb-devel] [PATCH] Re-power USB ports on wakeup Message-ID: <20050316144609.62da0122@jack.colino.net> In-Reply-To: <200503151736.36430.david-b@pacbell.net> References: <20050315173450.721b9525@jack.colino.net> <200503151736.36430.david-b@pacbell.net> X-Mailer: Sylpheed-Claws 1.0.1cvs22.2 (GTK+ 2.6.1; powerpc-unknown-linux-gnu) X-Face: Fy:*XpRna1/tz}cJ@O'0^:qYs:8b[Rg`*8,+o^[fI?<%5LeB,Xz8ZJK[r7V0hBs8G)*&C+XA0qHoR=LoTohe@7X5K$A-@cN6n~~J/]+{[)E4h'lK$13WQf$.R+Pi;E09tk&{t|;~dakRD%CLHrk6m!?gA,5|Sb=fJ=>[9#n1Bu8?VngkVM4{'^'V_qgdA.8yn3) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On 15 Mar 2005 at 17h03, David Brownell wrote: Hi, > This patch is self-evidently incorrect: by definition, a suspended > port maintains VBUS power. Otherwise the device connected to the > port will get disconnected, rather than suspended ... and it won't > be able to issue wakeup events. All suspending does is stop sending > USB traffic down the port, notably SOF tokens; the device connected > to the port then enters a low power mode, typically consuming at most > 500uA from VBUS (vs typically 100mA when it's active/configured). Another idea. Is it harmful to "re-power" already powered ports? For example like this: Signed-off-by: Colin Leroy --- a/drivers/usb/host/ehci-hcd.c 2005-03-15 17:28:52.000000000 +0100 +++ b/drivers/usb/host/ehci-hcd.c 2005-03-16 14:44:06.000000000 +0100 @@ -773,14 +775,12 @@ /* here we "know" root ports should always stay powered; * but some controllers may lost all power. */ - if (powerup) { - ehci_dbg (ehci, "...powerup ports...\n"); - for (port = HCS_N_PORTS (ehci->hcs_params); port > 0; ) - (void) ehci_hub_control(hcd, - SetPortFeature, USB_PORT_FEAT_POWER, - port--, NULL, 0); - msleep(20); - } + ehci_dbg (ehci, "...powerup ports...\n"); + for (port = HCS_N_PORTS (ehci->hcs_params); port > 0; ) + (void) ehci_hub_control(hcd, + SetPortFeature, USB_PORT_FEAT_POWER, + port--, NULL, 0); + msleep(20); } return retval;