From: Chunfeng Yun <chunfeng.yun@mediatek.com>
To: Alan Cooper <alcooperx@gmail.com>
Cc: ": Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
Alan Stern <stern@rowland.harvard.edu>,
Alban Bedel <albeu@free.fr>, Alex Elder <elder@linaro.org>,
Andrew Morton <akpm@linux-foundation.org>,
Arnd Bergmann <arnd@arndb.de>,
Avi Fishman <avifishman70@gmail.com>,
bcm-kernel-feedback-list@broadcom.com,
Bjorn Andersson <bjorn.andersson@linaro.org>,
"David S. Miller" <davem@davemloft.net>,
DTML <devicetree@vger.kernel.org>,
Dmitry Osipenko <digetx@gmail.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"Gustavo A. R. Silva" <gustavo@embeddedor.com>,
Hans de Goede <hdegoede@redhat.com>,
James Hogan <jhogan@kernel.org>,
Jianguo Sun <sunjianguo1@huawei.com>,
Johan Hovold <johan@kernel.org>,
Kees Cook <keescook@chromium.org>,
US
Subject: Re: [PATCH V2 2/6] usb: core: Add ability to skip phy exit on suspend and init on resume
Date: Fri, 9 Nov 2018 16:08:44 +0800 [thread overview]
Message-ID: <1541750924.32173.81.camel@mhfsdcap03> (raw)
In-Reply-To: <CAOGqxeXmMWK53pAmjeUtpdXNeTa7UH7=VA6pAJyhxg_BsmU5+w@mail.gmail.com>
On Thu, 2018-11-08 at 17:50 -0500, Alan Cooper wrote:
> On Wed, Nov 7, 2018 at 8:43 PM Chunfeng Yun <chunfeng.yun@mediatek.com> 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<alcooperx@gmail.com>
> > > >> ---
> > > >> 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;
> > > >
> >
> >
next prev parent reply other threads:[~2018-11-09 8:08 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-30 22:30 [PATCH V2 2/6] usb: core: Add ability to skip phy exit on suspend and init on resume Alan Cooper
2018-11-08 1:43 ` Chunfeng Yun
2018-11-08 22:50 ` Alan Cooper
2018-11-09 8:08 ` Chunfeng Yun [this message]
2018-11-09 12:14 ` Alan Cooper
-- strict thread matches above, loose matches on Subject: below --
2018-10-17 22:29 [PATCH V2 0/6] Add XHCI, EHCI and OHCI support for Broadcom STB SoS's Al Cooper
2018-10-17 22:29 ` [PATCH V2 2/6] usb: core: Add ability to skip phy exit on suspend and init on resume Al Cooper
2018-10-18 1:46 ` Chunfeng Yun
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1541750924.32173.81.camel@mhfsdcap03 \
--to=chunfeng.yun@mediatek.com \
--cc=akpm@linux-foundation.org \
--cc=albeu@free.fr \
--cc=alcooperx@gmail.com \
--cc=arnd@arndb.de \
--cc=avifishman70@gmail.com \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=bjorn.andersson@linaro.org \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=digetx@gmail.com \
--cc=elder@linaro.org \
--cc=gregkh@linuxfoundation.org \
--cc=gustavo@embeddedor.com \
--cc=hdegoede@redhat.com \
--cc=jhogan@kernel.org \
--cc=johan@kernel.org \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=stern@rowland.harvard.edu \
--cc=sunjianguo1@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox