Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp300366imu; Wed, 7 Nov 2018 17:44:41 -0800 (PST) X-Google-Smtp-Source: AJdET5dhWE+CERYfes3X3cd0Q4Ig1pmu+KqjoOR9M3NjsOJSd/WEX//QGWEsCwPGhFvRc/XCoitP X-Received: by 2002:a62:3406:: with SMTP id b6-v6mr2692929pfa.50.1541641481585; Wed, 07 Nov 2018 17:44:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541641481; cv=none; d=google.com; s=arc-20160816; b=ej6SV0fjnA85lnFEg5W+2FyWS6eP8SlJZJVMUra4DPM0CvU8o45LeMPQvIdOMLm7z3 ivajPf4Vbiw+1dIPpUXrlNohG0z5v8O4BHpBVsbzbhrSXqXpIThqZOzh8loRFkKQTLrY n9YfJjL84v4u5LOk14nXsICWBFKMILEh6GYoB3hmjP2/7JvlS3FdY/CC2czNB4zsrrS5 orWBzTsMwZuiCBVns6sPxR1JbwMsR0fUK888s5WiEm/TrWYLLh7+dRqLVYBf6P6jx/oj sEdNSV9NJDTLx+PFaRN+7RIVxIfygZtufHq5IlrIm3/RWdjhGm5X/hCthxFVSUEO9y4m B2Yg== 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=7ur4/RD5OEDiNTiG3bsjaF0FfPJ0CvGbsk0EDEfOZTI=; b=myXP5f4xgwuAxiNphqd5i28bTklb3OOMsF/lXPELilgxVog8xoWBp6A/WSoeS8hRJR vmRrWDVJsIg7TFNxo3RJ7SFfHqhM9xOYC9Wk1XkJ1+ecDc/mF2kcftgt51S4EqP8K3a6 HShxOSUeq/fPnGlIVIirTHHRdWNQ59tQLNRCfVDazS+2JzBnIQUqZDiDA+ZpYFm3I2Ij +XpNioj/+JBpRqU5RRLXiLTMEytKKq3kt9UD9z0/8wJcx10jQMs/lJNpg06meLPydl/K BzbaNBdS/mmcYyfDVosAlAr17WUdxGDoLr/Gey98Lq2sindqb08byORtHFgtvZmLFCsj WLWg== 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 p76-v6si2576876pfj.244.2018.11.07.17.44.26; Wed, 07 Nov 2018 17:44:41 -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 S1728516AbeKHLRC (ORCPT + 99 others); Thu, 8 Nov 2018 06:17:02 -0500 Received: from mailgw02.mediatek.com ([1.203.163.81]:18782 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1728328AbeKHLRC (ORCPT ); Thu, 8 Nov 2018 06:17:02 -0500 X-UUID: 445eb31d240945c8ad443c6789c794a6-20181108 X-UUID: 445eb31d240945c8ad443c6789c794a6-20181108 Received: from mtkcas36.mediatek.inc [(172.27.4.250)] by mailgw02.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLS) with ESMTP id 751471535; Thu, 08 Nov 2018 09:43:55 +0800 Received: from MTKCAS32.mediatek.inc (172.27.4.184) by MTKMBS32N1.mediatek.inc (172.27.4.71) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Thu, 8 Nov 2018 09:43:54 +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; Thu, 8 Nov 2018 09:43:52 +0800 Message-ID: <1541641432.32173.71.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: Thu, 8 Nov 2018 09:43:52 +0800 In-Reply-To: References: 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 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 > > > > >> + > >> /* 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; > >