mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Felipe Balbi <balbi@ti.com>
To: "Grégory Herrero" <gregory.herrero@gmail.com>
Cc: Felipe Balbi <balbi@ti.com>, Greg KH <gregkh@linuxfoundation.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux USB Mailing List <linux-usb@vger.kernel.org>
Subject: Re: [GIT PULL] USB resume timeout rework for v4.1
Date: Thu, 9 Apr 2015 08:44:47 -0500	[thread overview]
Message-ID: <20150409134447.GA4393@saruman.tx.rr.com> (raw)
In-Reply-To: <CAHp8HtQp-ZzM=RHBBmtuW8izvRQ4vUupo94kfWBREP5_mShBXw@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 4941 bytes --]

On Thu, Apr 09, 2015 at 10:17:08AM +0000, Grégory Herrero wrote:
> Hi Felipe,
> 
> Following patch: usb: dwc2: hcd: use new USB_RESUME_TIMEOUT is not correct.
> The delay is currently done before the controller drives the resume timeout.
> Attached patch fix this issue.
> 
> 2015-04-07 22:49 GMT+00:00 Felipe Balbi <balbi@ti.com>:
> > Hi Greg,
> >
> > As promised, here's a pull request with only the resume timeout
> > patches. I've rebased and retested them with my available platforms.
> >
> > Let me know if you want anything to be changed.
> >
> > cheers
> >
> > The following changes since commit 3e457371f436e89ce9239674828f9729a36b2595:
> >
> >   usb: musb: Fix fifo reads for dm816x with musb_dsps (2015-03-24 11:36:38 -0500)
> >
> > are available in the git repository at:
> >
> >   git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git tags/usb-for-v4.1-part2
> >
> > for you to fetch changes up to bbc78c07a51f6fd29c227b1220a9016e585358ba:
> >
> >   usb: core: hub: use new USB_RESUME_TIMEOUT (2015-04-07 12:58:36 -0500)
> >
> > ----------------------------------------------------------------
> > usb: generic resume timeout for v4.1
> >
> > This part 2 pull request contains only the patches
> > which make sure everybody on linux uses the same
> > resume timeout value.
> >
> > Signed-off-by: Felipe Balbi <balbi@ti.com>
> >
> > ----------------------------------------------------------------
> > Felipe Balbi (14):
> >       usb: define a generic USB_RESUME_TIMEOUT macro
> >       usb: host: xhci: use new USB_RESUME_TIMEOUT
> >       usb: host: ehci: use new USB_RESUME_TIMEOUT
> >       usb: host: uhci: use new USB_RESUME_TIMEOUT
> >       usb: musb: use new USB_RESUME_TIMEOUT
> >       usb: host: isp116x: use new USB_RESUME_TIMEOUT
> >       usb: host: fotg210: use new USB_RESUME_TIMEOUT
> >       usb: host: fusbh200: use new USB_RESUME_TIMEOUT
> >       usb: host: oxu210hp: use new USB_RESUME_TIMEOUT
> >       usb: host: r8a66597: use new USB_RESUME_TIMEOUT
> >       usb: host: sl811: use new USB_RESUME_TIMEOUT
> >       usb: dwc2: hcd: use new USB_RESUME_TIMEOUT
> >       usb: isp1760: hcd: use new USB_RESUME_TIMEOUT
> >       usb: core: hub: use new USB_RESUME_TIMEOUT
> >
> >  drivers/usb/core/hub.c            |  4 ++--
> >  drivers/usb/dwc2/hcd.c            |  2 +-
> >  drivers/usb/host/ehci-hcd.c       | 10 +++++-----
> >  drivers/usb/host/ehci-hub.c       |  9 ++++++---
> >  drivers/usb/host/fotg210-hcd.c    |  2 +-
> >  drivers/usb/host/fusbh200-hcd.c   |  3 +--
> >  drivers/usb/host/isp116x-hcd.c    |  2 +-
> >  drivers/usb/host/oxu210hp-hcd.c   |  7 ++++---
> >  drivers/usb/host/r8a66597-hcd.c   |  2 +-
> >  drivers/usb/host/sl811-hcd.c      |  2 +-
> >  drivers/usb/host/uhci-hub.c       |  5 +++--
> >  drivers/usb/host/xhci-ring.c      |  2 +-
> >  drivers/usb/isp1760/isp1760-hcd.c |  2 +-
> >  drivers/usb/musb/musb_core.c      |  7 ++++---
> >  drivers/usb/musb/musb_virthub.c   |  2 +-
> >  include/linux/usb.h               | 26 ++++++++++++++++++++++++++
> >  16 files changed, 59 insertions(+), 28 deletions(-)
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-usb" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html

> From d4996890e535d0582cc845bbeaa75ad4de693d92 Mon Sep 17 00:00:00 2001
> From: Gregory Herrero <gregory.herrero@intel.com>
> Date: Fri, 3 Apr 2015 10:53:25 +0200
> Subject: [PATCH] usb: dwc2: host: sleep USB_RESUME_TIMEOUT during resume
> 
> msleep(USB_RESUME_TIMEOUT) must be done when the controller drives
> the resume. This is true after HPRT0_RES is written.
> Moreover, restore the delay after controller power is up.
> 
> Signed-off-by: Gregory Herrero <gregory.herrero@intel.com>
> ---
>  drivers/usb/dwc2/hcd.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c
> index fdf40a0..4b6f4ab 100644
> --- a/drivers/usb/dwc2/hcd.c
> +++ b/drivers/usb/dwc2/hcd.c
> @@ -1534,13 +1534,13 @@ static int dwc2_hcd_hub_control(struct dwc2_hsotg *hsotg, u16 typereq,
>  			dev_dbg(hsotg->dev,
>  				"ClearPortFeature USB_PORT_FEAT_SUSPEND\n");
>  			writel(0, hsotg->regs + PCGCTL);
> -			msleep(USB_RESUME_TIMEOUT);
> +			usleep_range(20000, 40000);
>  
>  			hprt0 = dwc2_read_hprt0(hsotg);
>  			hprt0 |= HPRT0_RES;
>  			writel(hprt0, hsotg->regs + HPRT0);
>  			hprt0 &= ~HPRT0_SUSP;
> -			usleep_range(100000, 150000);
> +			msleep(USB_RESUME_TIMEOUT);
>  
>  			hprt0 &= ~HPRT0_RES;
>  			writel(hprt0, hsotg->regs + HPRT0);

Greg, I can fold this into original patch, but then I guess it becomes
too late to get this into this merge window. Your call, should I resend
a pull request, or will you take this extra hunk as a separate patch ?

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2015-04-09 13:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-07 22:49 Felipe Balbi
2015-04-09 10:17 ` Grégory Herrero
2015-04-09 13:44   ` Felipe Balbi [this message]
2015-04-10 11:53     ` Greg KH
2015-04-10 15:21       ` Felipe Balbi

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=20150409134447.GA4393@saruman.tx.rr.com \
    --to=balbi@ti.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=gregory.herrero@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    /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

Powered by JetHome