Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp63446imu; Thu, 8 Nov 2018 14:52:45 -0800 (PST) X-Google-Smtp-Source: AJdET5fYeR0RNlcx/9Nt4AFafxgpReIpQUPBaIRe8xICQ5ABl4CLJW1ZDjj9b7nJ6bK96lxDKWDT X-Received: by 2002:a62:3501:: with SMTP id c1-v6mr6407574pfa.173.1541717565917; Thu, 08 Nov 2018 14:52:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541717565; cv=none; d=google.com; s=arc-20160816; b=Uso79vOoo+dXHh5VCPUgFiXY/0w4OA8u59b7cV+s8kyBPPCzKaYGpA5Zj+7IGa4z1v Tva1LtspwsTtAXGASgJcVf/8Y92eGX9LWG7SjTkUDqHkrzN68wMngUbuIzc4AffRUkxK lmGO8m0HsvPSD5W/hj5MMI2eUeOAYPHQDujRBckFd7OEmk0+vxpttBChtAEQSH5b0+qI k4rUZ4/ujtp+0xGP7aCpnxLwj3fkjdYhx1OaHlBdU4f8TnD4aqh0n/LcG1rItq/78BGM 98DdgTfvne8rVC8nSDkyk/lHfMzD/pqYDuIHDaCC/jnCIC/XN2W2Ul30bA0hAAXak1aF cW5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=Gfif6lB2fAuBld0HGfJTiksU1vADvbBo/UGH1GtqzF0=; b=SXAP/XFwgT6yUdyNDuqYP9Av03toBQ6AXGXTIPwziBoZWdYjBUKtBFkDHveZnVlVLR 3DH4kvSwRBv/RQiywtuPzjO67MuLPg1muQMZqtFUdnVlHIf0KU8o52L1hbqPPcKXn8/T YUBLGHQ4oNjhQf1jc0Hvsml6RwJrIJC1VKxJRN9Rg4pM2GTGSoaBUWa0n5cyx+o1A4nZ neQ4o02FqyMifnPcjgpDbDrxXmT2S/0t9Ppf9Fro4+JygHLX4hjjTjYo41hwR9TfQtqL XzEqlotv/rfbQnsc4aEPfX27cQ4H2GDvOokrZgA/Wh17hPsHwxXm2zfrbEXW8dqC0Ivo Ei2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=kUQzhSyt; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g8-v6si5762041pli.338.2018.11.08.14.52.30; Thu, 08 Nov 2018 14:52:45 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=kUQzhSyt; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727522AbeKII2i (ORCPT + 99 others); Fri, 9 Nov 2018 03:28:38 -0500 Received: from mail-vk1-f195.google.com ([209.85.221.195]:40191 "EHLO mail-vk1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726875AbeKII2i (ORCPT ); Fri, 9 Nov 2018 03:28:38 -0500 Received: by mail-vk1-f195.google.com with SMTP id v70so4966203vkv.7; Thu, 08 Nov 2018 14:50:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Gfif6lB2fAuBld0HGfJTiksU1vADvbBo/UGH1GtqzF0=; b=kUQzhSyt0yqGFICZmNDSHRVIzh0QcdsknowmGfF2GSASGhZ/YOGBJF9uI1iJRrAtHV ouH0iv9JcQbFV4Ou3SrgNlwtkVaAQcw/PCtL6KnNYCcbNlvJJH0p3e1QtUW+TdYpZjsT Wk7kZyKoaUJ+uEoeRZ8zugO0ZliQZckSj9dwyLorqCxXWYwT91cnUHvMCo9mhfcEf8yn KiB214ykvKEs8lIoEyVaP8l6pAZUpd589YvMJDGPgA5G1VDwhiKf122N1Vd6T59XCnge uxcgpi5hCWXLZunTXWshMweQSiYHa3JE2z/plA2mLfwZk4+K2g/tV9h/tXdKjghUfLdb Qv5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Gfif6lB2fAuBld0HGfJTiksU1vADvbBo/UGH1GtqzF0=; b=swFx1moY4llov3CXOZU3SMyFPNKGMUj+lcGIy0nUNOYf3rDShFi+sOsZCR6WEEXw7b gJkuqSImbN+Iw81zumjdcvHc3bbwVXfnZeKMnwP5ck9drYd6UxheAr7hovAqqDy6Nqth WQ1K4XEbclxMEFAMed+nlAOLPgldCw13f1GZvh2dAFZUaTaJsIg4Pk3O6rt5zp5vzdV+ jyiLA4RAYmM192gS9kIeAlA6uGWsV5E5bDJefzro4QV3PTJJ4zKOO8ZcJM33aajk/FqO ooctntWTwN4VM6gnvw/2K8idIlcuyyBxYY4PKRi/803FgBWvu4b2tN+nvFGSUKaxqSQi czoA== X-Gm-Message-State: AGRZ1gKPL1DuDifgPNFI8ktNaXYRyCj5pXtyhMOzBsHlfK079JUtPHc2 6kVBePGM8PPQVlJ40Tkyvs6r/GttjlxQGHtmKyU= X-Received: by 2002:a1f:1383:: with SMTP id 125mr2986532vkt.46.1541717451995; Thu, 08 Nov 2018 14:50:51 -0800 (PST) MIME-Version: 1.0 References: <1541641432.32173.71.camel@mhfsdcap03> In-Reply-To: <1541641432.32173.71.camel@mhfsdcap03> From: Alan Cooper Date: Thu, 8 Nov 2018 17:50:49 -0500 Message-ID: Subject: Re: [PATCH V2 2/6] usb: core: Add ability to skip phy exit on suspend and init on resume To: chunfeng yun Cc: ": Linux Kernel Mailing List" , Alan Stern , Alban Bedel , Alex Elder , Andrew Morton , Arnd Bergmann , Avi Fishman , bcm-kernel-feedback-list@broadcom.com, 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? 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; > > > > >