From owner-cvs-all Wed Apr 10 6: 6:35 2002 Delivered-To: cvs-all@freebsd.org Received: from mail.speakeasy.net (mail17.speakeasy.net [216.254.0.217]) by hub.freebsd.org (Postfix) with ESMTP id 5969A37B419 for ; Wed, 10 Apr 2002 06:06:23 -0700 (PDT) Received: (qmail 5390 invoked from network); 10 Apr 2002 13:06:21 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) by mail17.speakeasy.net (qmail-ldap-1.03) with DES-CBC3-SHA encrypted SMTP for ; 10 Apr 2002 13:06:21 -0000 Received: from laptop.baldwin.cx (john@laptop.baldwin.cx [192.168.0.4]) by server.baldwin.cx (8.11.6/8.11.6) with ESMTP id g3AD78v52788; Wed, 10 Apr 2002 09:07:08 -0400 (EDT) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.5.2 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <20020410204138.C7535-100000@gamplex.bde.org> Date: Wed, 10 Apr 2002 09:06:18 -0400 (EDT) From: John Baldwin To: Bruce Evans Subject: Re: cvs commit: src/sys/dev/digi digi.c Cc: cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org, Brian Somers 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 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. > Bruce -- John Baldwin <>< 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