From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 11266C0044C for ; Thu, 8 Nov 2018 01:44:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CDF4E20862 for ; Thu, 8 Nov 2018 01:44:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CDF4E20862 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728521AbeKHLRC (ORCPT ); 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; > >