From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932367AbbGHTmB (ORCPT ); Wed, 8 Jul 2015 15:42:01 -0400 Received: from mail-vn0-f52.google.com ([209.85.216.52]:34744 "EHLO mail-vn0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755439AbbGHTlw (ORCPT ); Wed, 8 Jul 2015 15:41:52 -0400 MIME-Version: 1.0 In-Reply-To: References: Date: Wed, 8 Jul 2015 12:41:51 -0700 X-Google-Sender-Auth: mBj-jcurEref7dVrqoVqQErGvyI Message-ID: Subject: Re: [REPOST PATCH 3/3] USB: dwc2: Don't turn off the usbphy in suspend if wakeup is enabled From: Julius Werner To: Alan Stern Cc: Julius Werner , Felipe Balbi , Douglas Anderson , Greg Kroah-Hartman , John Youn , "linux-usb@vger.kernel.org" , Chris Zhong , Heiko Stuebner , Andrew Bresticker , Alexandru Stan , lyz , "open list:ARM/Rockchip SoC..." , LKML Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > 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 driver, I guess. Iterate over all ports, call usb_wakeup_enabled_descendants() on the connected device (if any) and disable that port's PHY if it returns 0 or wasn't connected. Since usb_wakeup_enabled_descendants() also counts do_remote_wakeup from the device itself and is safe to call even on non-hubs, that should work for all cases.