From owner-freebsd-arch Thu Jan 3 20:38:22 2002 Delivered-To: freebsd-arch@freebsd.org Received: from rover.village.org (rover.bsdimp.com [204.144.255.66]) by hub.freebsd.org (Postfix) with ESMTP id A49BC37B405 for ; Thu, 3 Jan 2002 20:38:19 -0800 (PST) Received: from harmony.village.org (harmony.village.org [10.0.0.6]) by rover.village.org (8.11.3/8.11.3) with ESMTP id g044cIl50736; Thu, 3 Jan 2002 21:38:18 -0700 (MST) (envelope-from imp@village.org) Received: from localhost (warner@rover2.village.org [10.0.0.1]) by harmony.village.org (8.11.6/8.11.6) with ESMTP id g044cGx04988; Thu, 3 Jan 2002 21:38:16 -0700 (MST) (envelope-from imp@village.org) Date: Thu, 03 Jan 2002 21:38:08 -0700 (MST) Message-Id: <20020103.213808.117908981.imp@village.org> To: silby@silby.com Cc: bde@zeta.org.au, freebsd-arch@FreeBSD.ORG Subject: Re: DELAY accuracy Re: cvs commit: src/sys/dev/usb uhci.c From: "M. Warner Losh" In-Reply-To: References: <20020103194429.T15755-100000@gamplex.bde.org> X-Mailer: Mew version 2.1 on Emacs 21.1 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In message: Mike Silbersack writes: : As for the users of large DELAY values (1000 or greater), I wonder if more : drastic measures should be taken, such as changing such calls to use : tsleep / timeout. It seems like a bad idea to stop the kernel for such : periods of time. (Most of these usages seem to be used during device : startup and error handling cases. While startup probably occurs only : once, I could see how one device driver delaying for a long period of time : due to an underrun/overrun could cause another device to do the same.) We have a routine in our code called tsc_delay (tsc == company name, not pentium counter) that will DELAY if the interrupts aren't running yet (or if the delay is < 1hz), and tsleep if they are. Not universally useful (bad in interrupt handlers :-), but good for some code that has to run either at load time or during the boot process... Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message