From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933830AbbDJPWN (ORCPT ); Fri, 10 Apr 2015 11:22:13 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:58949 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933028AbbDJPWL (ORCPT ); Fri, 10 Apr 2015 11:22:11 -0400 Date: Fri, 10 Apr 2015 10:21:00 -0500 From: Felipe Balbi To: Greg KH CC: Felipe Balbi , =?iso-8859-1?Q?Gr=E9gory?= Herrero , Linux Kernel Mailing List , Linux USB Mailing List Subject: Re: [GIT PULL] USB resume timeout rework for v4.1 Message-ID: <20150410152100.GB19781@saruman.tx.rr.com> Reply-To: References: <1428446960-2683-1-git-send-email-balbi@ti.com> <20150409134447.GA4393@saruman.tx.rr.com> <20150410115314.GB16818@kroah.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="SkvwRMAIpAhPCcCJ" Content-Disposition: inline In-Reply-To: <20150410115314.GB16818@kroah.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --SkvwRMAIpAhPCcCJ Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Apr 10, 2015 at 01:53:14PM +0200, Greg KH wrote: > On Thu, Apr 09, 2015 at 08:44:47AM -0500, Felipe Balbi wrote: > > On Thu, Apr 09, 2015 at 10:17:08AM +0000, Gr=E9gory Herrero wrote: > > > Hi Felipe, > > >=20 > > > Following patch: usb: dwc2: hcd: use new USB_RESUME_TIMEOUT is not co= rrect. > > > The delay is currently done before the controller drives the resume t= imeout. > > > Attached patch fix this issue. > > >=20 > > > 2015-04-07 22:49 GMT+00:00 Felipe Balbi : > > > > 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 3e457371f436e89ce9239674828f9729= a36b2595: > > > > > > > > usb: musb: Fix fifo reads for dm816x with musb_dsps (2015-03-24 1= 1: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 bbc78c07a51f6fd29c227b1220a9016e5853= 58ba: > > > > > > > > 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 > > > > > > > > ---------------------------------------------------------------- > > > > 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 > >=20 > > > From d4996890e535d0582cc845bbeaa75ad4de693d92 Mon Sep 17 00:00:00 2001 > > > From: Gregory Herrero > > > Date: Fri, 3 Apr 2015 10:53:25 +0200 > > > Subject: [PATCH] usb: dwc2: host: sleep USB_RESUME_TIMEOUT during res= ume > > >=20 > > > 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. > > >=20 > > > Signed-off-by: Gregory Herrero > > > --- > > > drivers/usb/dwc2/hcd.c | 4 ++-- > > > 1 file changed, 2 insertions(+), 2 deletions(-) > > >=20 > > > 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_h= sotg *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); > > > =20 > > > hprt0 =3D dwc2_read_hprt0(hsotg); > > > hprt0 |=3D HPRT0_RES; > > > writel(hprt0, hsotg->regs + HPRT0); > > > hprt0 &=3D ~HPRT0_SUSP; > > > - usleep_range(100000, 150000); > > > + msleep(USB_RESUME_TIMEOUT); > > > =20 > > > hprt0 &=3D ~HPRT0_RES; > > > writel(hprt0, hsotg->regs + HPRT0); > >=20 > > 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 ? >=20 > I've taken your pull request and added this patch on top of it, so all > should be good now. Alright, thanks Greg. --=20 balbi --SkvwRMAIpAhPCcCJ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJVJ+pcAAoJEIaOsuA1yqREnFQP/2wc3ELkL7DIo/Px6ueaHCQN zU0aw6yikesEvbTjDMQUg2/YOSm6PgGs7+SU8wwRhFHC9O+sVQaXfY66bupuYt9M 5VDNywaB8MLBUhOTc6omJ1Bz9HUrFeAGrB+AnUO+u9t1dW+KAdgnAcDrPeWOwT61 QRi6pXp3XB3t2wn4DlidJBg3TR8IVEHayE9IQAPsRYm5908fRQyIK9AhyjlDT9r2 OT3pS2Rcl/yHO2vKiiIP+XGPTW3U0b9s5D1LJYHoRvL+Y5n+KLgfsH8fqz1HxXet W0xJwXEz1hhHhx1QUPWdDMy/Lwk9YrGjDqb4jI6yF4G2zI2hDLQP2OFWw0tJKqtV fcaAnePDK8UdpFPkWKXL1dmyJwTcEVWRlT2bObM+XCtxM+SYxEfkP4P42Zv9GnV+ ElIvMTiGMv5y2ZPcBRixdC7zDX5sfbPWIypvrnw0PaBTBVDh+lGBB1NVSfNaQtlG TkApVr0ShPVZ4pwaW3n3s8GhF+61MErJwH5E/RkW8BVRenlDAANtDduQIiXLkMY2 L04y8DlVliLC0kMOJNA+FE0zQoH3sI8JRL3kGCgns8NZP0g3FGB7K55DlImd4/hT sVgacReg8kxQ21BhUkjI7RmUaeJHxkdB8nEVEwpp1JbG1bLZCIGTGHPNBsoz8Jm6 4LAQ2HkUbrnFYkZC3YWp =FEIY -----END PGP SIGNATURE----- --SkvwRMAIpAhPCcCJ--