From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chunfeng Yun Subject: Re: [PATCH V2 2/6] usb: core: Add ability to skip phy exit on suspend and init on resume Date: Thu, 8 Nov 2018 09:43:52 +0800 Message-ID: <1541641432.32173.71.camel@mhfsdcap03> References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org To: Alan Cooper 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 , US List-Id: devicetree@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; > >