Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 Apr 2002 14:27:06 -0400 (EDT)
From:      John Baldwin <jhb@FreeBSD.org>
To:        Jake Burkholder <jake@locore.ca>
Cc:        Brian Somers <brian@FreeBSD.org>, cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org, Bruce Evans <bde@zeta.org.au>
Subject:   Re: cvs commit: src/sys/dev/digi digi.c
Message-ID:  <XFMail.20020410142706.jhb@FreeBSD.org>
In-Reply-To: <20020410105203.B209@locore.ca>

next in thread | previous in thread | raw e-mail | index | archive | help

On 10-Apr-2002 Jake Burkholder wrote:
> 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.

I wouldn't object to doing that but that isn't trivial.  I also have a pet
peeve about (ab)using tsleep() to do delays but that is a more minor issue.

> Jake

-- 

John Baldwin <jhb@FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.20020410142706.jhb>