From owner-svn-src-head@FreeBSD.ORG Tue Nov 15 20:54:30 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6592D106564A; Tue, 15 Nov 2011 20:54:30 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-gx0-f182.google.com (mail-gx0-f182.google.com [209.85.161.182]) by mx1.freebsd.org (Postfix) with ESMTP id DE3FF8FC18; Tue, 15 Nov 2011 20:54:29 +0000 (UTC) Received: by ggnk3 with SMTP id k3so11239559ggn.13 for ; Tue, 15 Nov 2011 12:54:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=CnXDcX6wBp4h9e3XeWXWTETzA5WKLzkHmSSxOJGXXIM=; b=EN9qwQIXQJD6LU1gQwMRARyMwq9nXuZtPkv7WlATrQ2Y+CBUfZrgovWnrFxMRDkiV1 lvRlsNCqn+nCtEazaMhSI5h+2KXsbv3TX/kHKcEQzomnxct8V2IuiBm4ZWKJC8PNrrqn /zsUmA4H85pt4tnmtKoo7Z2vqwgO4nWqv0dAk= MIME-Version: 1.0 Received: by 10.68.33.134 with SMTP id r6mr45165034pbi.76.1321390468700; Tue, 15 Nov 2011 12:54:28 -0800 (PST) Sender: mdf356@gmail.com Received: by 10.68.56.97 with HTTP; Tue, 15 Nov 2011 12:54:28 -0800 (PST) In-Reply-To: <201111152048.pAFKmvNC016452@svn.freebsd.org> References: <201111152048.pAFKmvNC016452@svn.freebsd.org> Date: Tue, 15 Nov 2011 12:54:28 -0800 X-Google-Sender-Auth: -K05PwodM79mP2ii76YH8H_m4bw Message-ID: From: mdf@FreeBSD.org To: Hans Petter Selasky Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r227541 - head/sys/dev/usb/controller X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Nov 2011 20:54:30 -0000 On Tue, Nov 15, 2011 at 12:48 PM, Hans Petter Selasky wrote: > Author: hselasky > Date: Tue Nov 15 20:48:57 2011 > New Revision: 227541 > URL: http://svn.freebsd.org/changeset/base/227541 > > Log: > =A0Some brands of XHCI controllers needs more time to reset. ... and since there's no guarantee that hz is 1000 or has any particular value, most of these seem a bit spurious. Is there some reason these functions aren't asking for a delay in terms of milli- or microseconds, and converting to hz internally? I would expect a delay while waiting for hardware to have a wall-clock time, not a time relative to hz, which has no predefined range. Thanks, matthew > =A0Reported by: =A0Jan Henrik Sylvester > =A0MFC after: =A0 =A01 week > > Modified: > =A0head/sys/dev/usb/controller/xhci.c > > Modified: head/sys/dev/usb/controller/xhci.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/usb/controller/xhci.c =A0Tue Nov 15 20:41:50 2011 =A0 = =A0 =A0 =A0(r227540) > +++ head/sys/dev/usb/controller/xhci.c =A0Tue Nov 15 20:48:57 2011 =A0 = =A0 =A0 =A0(r227541) > @@ -292,7 +292,7 @@ xhci_start_controller(struct xhci_softc > =A0 =A0 =A0 =A0XWRITE4(sc, oper, XHCI_USBCMD, XHCI_CMD_HCRST); > > =A0 =A0 =A0 =A0for (i =3D 0; i !=3D 100; i++) { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 usb_pause_mtx(NULL, hz / 1000); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 usb_pause_mtx(NULL, hz / 100); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0temp =3D XREAD4(sc, oper, XHCI_USBCMD) & > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(XHCI_CMD_HCRST | XHCI_STS_CNR); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (!temp) > @@ -453,7 +453,7 @@ xhci_start_controller(struct xhci_softc > =A0 =A0 =A0 =A0 =A0 =A0XHCI_CMD_INTE | XHCI_CMD_HSEE); > > =A0 =A0 =A0 =A0for (i =3D 0; i !=3D 100; i++) { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 usb_pause_mtx(NULL, hz / 1000); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 usb_pause_mtx(NULL, hz / 100); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0temp =3D XREAD4(sc, oper, XHCI_USBSTS) & X= HCI_STS_HCH; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (!temp) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0break; > @@ -487,7 +487,7 @@ xhci_halt_controller(struct xhci_softc * > =A0 =A0 =A0 =A0XWRITE4(sc, oper, XHCI_USBCMD, 0); > > =A0 =A0 =A0 =A0for (i =3D 0; i !=3D 100; i++) { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 usb_pause_mtx(NULL, hz / 1000); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 usb_pause_mtx(NULL, hz / 100); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0temp =3D XREAD4(sc, oper, XHCI_USBSTS) & X= HCI_STS_HCH; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (temp) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0break; >