From owner-svn-src-head@FreeBSD.ORG Tue Nov 15 21:15:14 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 B6B6D1065674; Tue, 15 Nov 2011 21:15:14 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe04.c2i.net [212.247.154.98]) by mx1.freebsd.org (Postfix) with ESMTP id 13C458FC15; Tue, 15 Nov 2011 21:15:13 +0000 (UTC) X-T2-Spam-Status: No, hits=2.5 required=5.0 tests=ALL_TRUSTED, BAYES_99 Received: from [188.126.198.129] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe04.swip.net (CommuniGate Pro SMTP 5.2.19) with ESMTPA id 203774857; Tue, 15 Nov 2011 22:05:09 +0100 From: Hans Petter Selasky To: mdf@freebsd.org Date: Tue, 15 Nov 2011 22:02:24 +0100 User-Agent: KMail/1.13.5 (FreeBSD/8.2-STABLE; KDE/4.4.5; amd64; ; ) References: <201111152048.pAFKmvNC016452@svn.freebsd.org> In-Reply-To: X-Face: *nPdTl_}RuAI6^PVpA02T?$%Xa^>@hE0uyUIoiha$pC:9TVgl.Oq,NwSZ4V" =?windows-1252?q?=7CLR=2E+tj=7Dg5=0A=09=25V?=,x^qOs~mnU3]Gn; cQLv&.N>TrxmSFf+p6(30a/{)KUU!s}w\IhQBj}[g}bj0I3^glmC( =?windows-1252?q?=0A=09=3AAuzV9=3A=2EhESm-x4h240C=609=3Dw?= MIME-Version: 1.0 Content-Type: Text/Plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Message-Id: <201111152202.24093.hselasky@c2i.net> 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 21:15:14 -0000 On Tuesday 15 November 2011 21:54:28 mdf@freebsd.org wrote: > 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: > > Some brands of XHCI controllers needs more time to reset. > Hi, > ... and since there's no guarantee that hz is 1000 or has any > particular value, most of these seem a bit spurious. The delays are a bit loosely defined, hence I think there is no clear definition what the minimum and maximum delay time is in the XHCI spec. The delay given just defines the minimum. It is not critical if the delay is larger, just that there is some kind of timeout. I use pause() because that doesn't block if the modules are loaded after boot. usb_pause_mtx() has an "if (cold)" check inside. > > 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. I have some macros that convert from hz to ms internally in the USB stack, though I see your point that if hz is low, then the specified value derivates from the real delay time. For USB compliant operation, the USB stack requires hz to be greater or equal to 250 hz, to put it like that. Mostly a requirement in USB gadget/device mode. --HPS