Date: Fri, 23 Sep 2011 16:21:06 +0100 From: Gavin Atkinson <gavin.atkinson@ury.york.ac.uk> To: Hans Petter Selasky <hselasky@c2i.net> Cc: freebsd-current@freebsd.org, "freebsd-drivers@freebsd.org" <freebsd-drivers@freebsd.org> Subject: Re: Choosing between DELAY(useconds) and pause() Message-ID: <1316791266.39972.3.camel@buffy.york.ac.uk> In-Reply-To: <201109222007.19182.hselasky@c2i.net> References: <75E1A2A7D185F841A975979B0906BBA67BCCAB7609@AVEXMB1.qlogic.org> <201109222007.19182.hselasky@c2i.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 2011-09-22 at 20:07 +0200, Hans Petter Selasky wrote: > On Thursday 22 September 2011 19:55:23 David Somayajulu wrote: > > It appears that the pause() function cannot be used in driver functions > > which are invoked early in the boot process. Is there is a kernel api > > which a device driver can use to determine whether to use pause() or > > DELAY(), for delays which are say greater than 10hz - may be even 1 hz ? > > Maybe you want to use something like this: > > if (cold) > DELAY() > else > pause() > > In your code. Note that this still shouldn't be done in your suspend/resume paths, as "cold" isn't set there, however there also appears to be no guarantee that pause() will ever return (as you could be running after the timer has been suspended, or before it resumes). I'm not sure what the correct answer is for suspend/resume code. Gavin
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1316791266.39972.3.camel>