All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Xu Yang <xu.yang_2@nxp.com>
Cc: "peter.chen@kernel.org" <peter.chen@kernel.org>,
	Jun Li <jun.li@nxp.com>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	dl-linux-imx <linux-imx@nxp.com>
Subject: Re: [EXT] Re: [PATCH 3/8] usb: chipidea: host: add suspend/resume support for host controller
Date: Mon, 10 Oct 2022 08:31:01 +0200	[thread overview]
Message-ID: <Y0O8Jeb36P65vx93@kroah.com> (raw)
In-Reply-To: <PAXPR04MB8784E2AE0AEE9ADB152E46E88C209@PAXPR04MB8784.eurprd04.prod.outlook.com>

On Mon, Oct 10, 2022 at 02:54:02AM +0000, Xu Yang wrote:
> Hi Greg,
> 
> > -----Original Message-----
> > From: Greg KH <gregkh@linuxfoundation.org>
> > Sent: Monday, October 10, 2022 2:36 AM
> > To: Xu Yang <xu.yang_2@nxp.com>
> > Cc: peter.chen@kernel.org; Jun Li <jun.li@nxp.com>; linux-usb@vger.kernel.org; dl-linux-imx <linux-imx@nxp.com>
> > Subject: [EXT] Re: [PATCH 3/8] usb: chipidea: host: add suspend/resume support for host controller
> > 
> > Caution: EXT Email
> > 
> > On Mon, Oct 10, 2022 at 12:08:08AM +0800, Xu Yang wrote:
> > > The controller's power may be powered off during system suspend. This
> > > will add suspend/resume support when the controller suffers power lost.
> > >
> > > Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
> > > ---
> > >  drivers/usb/chipidea/host.c | 12 ++++++++++++
> > >  1 file changed, 12 insertions(+)
> > >
> > > diff --git a/drivers/usb/chipidea/host.c b/drivers/usb/chipidea/host.c
> > > index bc3634a54c6b..dc033272c31e 100644
> > > --- a/drivers/usb/chipidea/host.c
> > > +++ b/drivers/usb/chipidea/host.c
> > > @@ -459,6 +459,16 @@ static void ci_hdrc_unmap_urb_for_dma(struct usb_hcd *hcd, struct urb *urb)
> > >       ci_hdrc_free_dma_aligned_buffer(urb);
> > >  }
> > >
> > > +static void ci_hdrc_host_suspend(struct ci_hdrc *ci)
> > > +{
> > > +     ehci_suspend(ci->hcd, device_may_wakeup(ci->dev));
> > 
> > Why is the chipidea driver somehow now tied to the ehci driver?
> 
> The chipidea host controller driver has been tied to ehci driver from the 
> beginning. Here, this patch will enhance the host controller by using ehci
> suspend/resume functions.
> 
> > 
> > Are you sure you want this?  Why?  Is hcd always a ehci device?
> 
> As the host controller may suffer power lost after system suspend, there is
> a need to restore it correctlly after system resume. ehci_suspend/resume()
> will handle the generic parts of controller suspend/resume, at the same time,
> ehci_resume() could handle power lost case by reporting this event to root
> hub and reset host controller in a normal way. So it's exactly a good choice
> to use them. 
> 
> As per chipidea RM: The USB 2.0 Controller is an instantiation of an 
> EHCI-compatible core which supports high-, full-, and low-speed operation.
> So this hcd will be a ehci device all the time.

Ah, sorry, you are right.  But the build breaks so you need to fix
something up to so that this dependancy really is there.

thanks,

greg k-h

  reply	other threads:[~2022-10-10  6:30 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-09 16:08 [PATCH 0/8] add power lost support during system suspend/resume Xu Yang
2022-10-09 16:08 ` [PATCH 1/8] usb: chipidea: core: add controller resume support when controller is powered off Xu Yang
2022-10-09  9:52   ` kernel test robot
2022-10-09 17:05   ` kernel test robot
2022-10-09 16:08 ` [PATCH 2/8] usb: chipidea: core: handle suspend/resume for each role Xu Yang
2022-10-09 16:08 ` [PATCH 3/8] usb: chipidea: host: add suspend/resume support for host controller Xu Yang
2022-10-09 12:22   ` kernel test robot
2022-10-09 18:35   ` Greg KH
2022-10-10  2:54     ` [EXT] " Xu Yang
2022-10-10  6:31       ` Greg KH [this message]
2022-10-09 16:08 ` [PATCH 4/8] usb: chipidea: udc: add suspend/resume support for device controller Xu Yang
2022-10-09 16:08 ` [PATCH 5/8] usb: chipidea: usbmisc: group usbmisc operations for PM Xu Yang
2022-10-09 16:08 ` [PATCH 6/8] usb: chipidea: usbmisc: add power lost check for imx6sx Xu Yang
2022-10-09 16:08 ` [PATCH 7/8] usb: chipidea: usbmisc: add power lost check for imx7d Xu Yang
2022-10-09 16:08 ` [PATCH 8/8] usb: chipidea: usbmisc: add power lost check for imx7ulp Xu Yang

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=Y0O8Jeb36P65vx93@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=jun.li@nxp.com \
    --cc=linux-imx@nxp.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=peter.chen@kernel.org \
    --cc=xu.yang_2@nxp.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.