Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755144AbaKNURX (ORCPT ); Fri, 14 Nov 2014 15:17:23 -0500 Received: from us01smtprelay-2.synopsys.com ([198.182.44.111]:50345 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754418AbaKNURV (ORCPT ); Fri, 14 Nov 2014 15:17:21 -0500 From: Paul Zimmerman To: Julius Werner , Kever Yang , Alan Stern CC: Doug Anderson , Felipe Balbi , "Dinh Nguyen" , Romain Perier , Heiko Stuebner , Sonny Rao , Addy Ke , Eddie Cai , lyz , wulf , Tao Huang , "open list:ARM/Rockchip SoC..." , Greg Kroah-Hartman , "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH v3] usb: dwc2: add bus suspend/resume for dwc2 Thread-Topic: [PATCH v3] usb: dwc2: add bus suspend/resume for dwc2 Thread-Index: AQHP/OemHIpdmIh/Rku4z/uYLWGLo5xeK1WAgAAWRACAAdeFAIAAeWgg Date: Fri, 14 Nov 2014 20:17:16 +0000 Message-ID: References: <1415624983-22413-1-git-send-email-kever.yang@rock-chips.com> <5463FE5E.906@rock-chips.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.9.64.241] Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by nfs id sAEKHUem003473 > From: jwerner@google.com [mailto:jwerner@google.com] On Behalf Of Julius Werner > Sent: Thursday, November 13, 2014 8:50 PM > > > I will figure out how to make dwc2 detect the device connect after auto > > suspend, > > or disable the auto suspend feature for the dwc2 hcd. > > I think auto-suspend of the root hub device (which is what calls > bus_suspend, but is not the host controller device itself) is expected > to always happen and not really meant to be disabled. I'm surprised > that the controller would fail to come back up, though. Does removing > the PCGCTL part make it work? That's the only thing I can think of > (but then again the function should immediately return if the port is > not in L0, so if there is nothing plugged in the suspend shouldn't > really do anything). Hi guys, I don't have any experience with suspend/resume on the dwc2 controller I'm afraid. One suggestion would be to look at our Synopsys vendor driver to see how it is handled there. That driver is part of the Raspberry Pi upstream kernel, which you can find at https://github.com/raspberrypi/linux. The driver is under drivers/usb/host/dwc_otg. In particular, in dwc_otg_cil_intr.c there is a function named dwc_otg_handle_wakeup_detected_intr() which might be of interest. Unfortunately, that driver code is rather convoluted, so it may be difficult to figure out exactly what the driver is doing. -- Paul ????{.n?+???????+%?????ݶ??w??{.n?+????{??G?????{ay?ʇڙ?,j??f???h?????????z_??(?階?ݢj"???m??????G????????????&???~???iO???z??v?^?m???? ????????I?