Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp463185imu; Fri, 9 Nov 2018 00:11:08 -0800 (PST) X-Google-Smtp-Source: AJdET5cb9YwXS5AQ2w/l4Cei4wRbWefJ8ycyhb5xgvGiiYz92T2tvVvooCKZZvfRzzjr+KH7LS9H X-Received: by 2002:a62:1954:: with SMTP id 81-v6mr7984684pfz.237.1541751068019; Fri, 09 Nov 2018 00:11:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541751067; cv=none; d=google.com; s=arc-20160816; b=taObtO21VSwq47D76S4GmrUDvi62eMAgiCxkPkfsaUJUCPX7NXzBHXEitd5txFlDuN fwSGnmnOwsQEZpaVzITDwa2VQOJO8WsONQjallCByTreC3KGy+lUvnsmDVfVaZQnqwMm 4ieu800f/u9eTwn+NY3R3aNYwmhlcY1xuERMIs3vC1WK4YA9vTi/8glYGpOiFdwZJS7f 0CQUmhlfcE11xr3ucjUsm74Z2BEn3IUubfb+F+8CgqMm8aHD97H4l6YTEAi+Prf0bBm+ ga6PScdnoTsPG1Rm1B/ikoNoOeWDFzp2b68AcVmTQ5uvAhOykdylZVohz4AfmKXqsItg ywag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :references:in-reply-to:date:cc:to:from:subject:message-id; bh=DjxlPBGK/D9A+5s9xbMTe6BbErOfCQro/GSoHYGHXCY=; b=b2JM5IpVKV3m5E6GT5v1BCmp5KGGu8gKAiHV1OPPDQA/rxpYm4Boh+GlFT+g/jJj1n Rh0T3hOrCRctMlrMTwU5Iq12w+WpNWTBkYDyOuKIZ6lSVO//kS4+VlbphRRjug93SeKo YVgPTjaOTLGHqub+D00kJ44Tvcod0ZOcyO6CYapJzi7lSsTaiXdx84DpiECNtr8WCQm8 vbJAAq6JSEY0wk/04lpSWM1ZqVNtT1AAH68ygaW4m2IDTmnT+rngRoVVuhUepr04cytA Wl7hIh2EQY7fe2w4Q5njt3aIgczZDPghW1WA0cXSMhh9p2uSii03yOIkp0y36dGBJIRV +x9g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y10-v6si6907077plt.145.2018.11.09.00.10.51; Fri, 09 Nov 2018 00:11:07 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728501AbeKIRsa (ORCPT + 99 others); Fri, 9 Nov 2018 12:48:30 -0500 Received: from mailgw02.mediatek.com ([1.203.163.81]:9135 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1728165AbeKIRs3 (ORCPT ); Fri, 9 Nov 2018 12:48:29 -0500 X-UUID: 31e1846d8d8e4210895d1c1e3f09ee99-20181109 X-UUID: 31e1846d8d8e4210895d1c1e3f09ee99-20181109 Received: from mtkcas36.mediatek.inc [(172.27.4.250)] by mailgw02.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLS) with ESMTP id 1074849497; Fri, 09 Nov 2018 16:08:47 +0800 Received: from MTKCAS32.mediatek.inc (172.27.4.184) by MTKMBS33DR.mediatek.inc (172.27.6.106) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Fri, 9 Nov 2018 16:08:45 +0800 Received: from [10.17.3.153] (10.17.3.153) by MTKCAS32.mediatek.inc (172.27.4.170) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Fri, 9 Nov 2018 16:08:44 +0800 Message-ID: <1541750924.32173.81.camel@mhfsdcap03> Subject: Re: [PATCH V2 2/6] usb: core: Add ability to skip phy exit on suspend and init on resume From: Chunfeng Yun To: Alan Cooper CC: ": Linux Kernel Mailing List" , Alan Stern , Alban Bedel , Alex Elder , Andrew Morton , "Arnd Bergmann" , Avi Fishman , , Bjorn Andersson , "David S. Miller" , DTML , Dmitry Osipenko , "Greg Kroah-Hartman" , "Gustavo A. R. Silva" , Hans de Goede , James Hogan , Jianguo Sun , Johan Hovold , Kees Cook , USB list , Lu Baolu , "Mark Rutland" , Martin Blumenstingl , Mathias Nyman , Mathias Nyman , Mauro Carvalho Chehab , Rishabh Bhatnagar , Rob Herring , Roger Quadros Date: Fri, 9 Nov 2018 16:08:44 +0800 In-Reply-To: References: <1541641432.32173.71.camel@mhfsdcap03> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.3-0ubuntu6 Content-Transfer-Encoding: 7bit MIME-Version: 1.0 X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2018-11-08 at 17:50 -0500, Alan Cooper wrote: > On Wed, Nov 7, 2018 at 8:43 PM Chunfeng Yun wrote: > > > > hi, > > On Tue, 2018-10-30 at 18:30 -0400, Alan Cooper wrote: > > > On 10/17/18 9:46 PM, Chunfeng Yun wrote:> hi, > > > > > > > > On Wed, 2018-10-17 at 18:29 -0400, Al Cooper wrote: > > > >> Add the ability to skip calling the PHY's exit routine on suspend > > > >> and the PHY's init routine on resume. This is to handle a USB PHY > > > >> that should have it's power_off function called on suspend but > > > cannot > > > >> have it's exit function called because on exit it will disable the > > > >> PHY to the point where register accesses to the Host Controllers > > > >> using the PHY will be disabled and the host drivers will crash. > > > >> > > > >> This is enabled with the HCD flag "suspend_without_phy_exit" which > > > >> can be set from any HCD driver. > > > >> > > > >> Signed-off-by: Al Cooper > > > >> --- > > > >> drivers/usb/core/hcd.c | 8 ++++---- > > > >> drivers/usb/core/phy.c | 18 ++++++++++++------ > > > >> drivers/usb/core/phy.h | 9 ++++++--- > > > >> include/linux/usb/hcd.h | 3 +++ > > > >> 4 files changed, 25 insertions(+), 13 deletions(-) > > > >> > > > > > > > >> unsigned skip_phy_initialization:1; > > > >> > > > >> + /* Some phys don't want the phy's exit/init called on > > > suspend/resume */ > > > >> + unsigned suspend_without_phy_exit:1; > > > > As suggested before, you can skip phy's exit/init during > > > suspend/resume > > > > by enabling wakeup of hcd, so needn't add a new variable for it. > > > > > > I still need to be able to enable and disable wakeup for this driver. > > Just use device_init_wakeup(dev, true) instead of > > device_wakeup_enable(dev) for your controller driver, you can try it. > > > > Sorry for the late replay > > What about the case where sysfs is used to disable wakeup? Oh, It's a problem in this case. BTW: Why the host driver will crash when access host controller's register after power-off phy? they are usually independent. > > Al > > > > > > > > > > >> + > > > >> /* The next flag is a stopgap, to be removed when all the > > > HCDs > > > >> * support the new root-hub polling mechanism. */ > > > >> unsigned uses_new_polling:1; > > > > > > > >