From owner-cvs-all Wed Apr 10 7:49:40 2002 Delivered-To: cvs-all@freebsd.org Received: from k6.locore.ca (k6.locore.ca [198.96.117.170]) by hub.freebsd.org (Postfix) with ESMTP id AF8D937B404; Wed, 10 Apr 2002 07:49:32 -0700 (PDT) Received: (from jake@localhost) by k6.locore.ca (8.11.6/8.11.6) id g3AEq3c02194; Wed, 10 Apr 2002 10:52:03 -0400 (EDT) (envelope-from jake) Date: Wed, 10 Apr 2002 10:52:03 -0400 From: Jake Burkholder To: John Baldwin Cc: Bruce Evans , cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org, Brian Somers Subject: Re: cvs commit: src/sys/dev/digi digi.c Message-ID: <20020410105203.B209@locore.ca> References: <20020410204138.C7535-100000@gamplex.bde.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from jhb@FreeBSD.org on Wed, Apr 10, 2002 at 09:06:18AM -0400 Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Apparently, On Wed, Apr 10, 2002 at 09:06:18AM -0400, John Baldwin said words to the effect of; > > On 10-Apr-2002 Bruce Evans wrote: > > On Tue, 9 Apr 2002, Brian Somers wrote: > > > >> brian 2002/04/09 20:13:28 PDT > >> > >> Modified files: > >> sys/dev/digi digi.c > >> Log: > >> Add a digi_delay() function and use it instead of tsleep() when polling > >> the card for command completion. > >> > >> digi_delay() uses either tsleep() or DELAY() depending on the value of > >> ``cold''. > >> > >> Pointed in the right direction by: jhb > > > > Maybe tsleep() should sleep when cold if given a timeout. This is not quite > > right, since the semantics of the timeout arg is to give a maximum wait, > > not a delay, but it is better than ... > > > >> > >> Revision Changes Path > >> 1.25 +14 -5 src/sys/dev/digi/digi.c > > > > N * (+14 -5) in N drivers. All drivers that support dynamic loading need > > something like this, since busy-waiting on running systems is unacceptable. > > Not that I will ever want to use this misfeature. > > I've thought about having some sort of separate API for code that just ways to > delay. Right now they use tsleep() on a channel that never gets woken up with > a timeout. If we had a delay(int timo) function then it could use a callout > when callouts were working and fall back to DELAY() in the cold case. No, this is wrong. Anything that uses cold is wrong. The correct fix is to move the clock initialization earlier in boot to be before the device probe. Jake To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message