From owner-cvs-all Thu Apr 5 2:41:25 2001 Delivered-To: cvs-all@freebsd.org Received: from fw.wintelcom.net (ns1.wintelcom.net [209.1.153.20]) by hub.freebsd.org (Postfix) with ESMTP id 7377437B424; Thu, 5 Apr 2001 02:41:19 -0700 (PDT) (envelope-from bright@fw.wintelcom.net) Received: (from bright@localhost) by fw.wintelcom.net (8.10.0/8.10.0) id f359fFI16039; Thu, 5 Apr 2001 02:41:15 -0700 (PDT) Date: Thu, 5 Apr 2001 02:41:15 -0700 From: Alfred Perlstein To: Luigi Rizzo Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/dev/wi if_wi.c Message-ID: <20010405024115.F17723@fw.wintelcom.net> References: <200104050925.f359Pfh75393@freefall.freebsd.org> <200104050929.LAA88010@info.iet.unipi.it> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200104050929.LAA88010@info.iet.unipi.it>; from luigi@info.iet.unipi.it on Thu, Apr 05, 2001 at 11:29:43AM +0200 X-all-your-base: are belong to us. Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG * Luigi Rizzo [010405 02:30] wrote: > > alfred 2001/04/05 02:25:41 PDT > > > > Modified files: > > sys/dev/wi if_wi.c > > Log: > > WI_TIMEOUT is 65536 > > > > 65536 * 10msec == 10 minutes 55 seconds == hung machine > > > > Instead wait for the busy bits for a max of ~2 seconds (200 * 10msec) > > it would be better to make it 2*HZ then, because someone > uses different values if HZ than the default (100) /* wait for the busy bit to clear */ for (i = 200; i > 0; i--) { if (!(CSR_READ_2(sc, WI_COMMAND) & WI_CMD_BUSY)) { break; } DELAY(10*1000); /* 10 m sec */ } if (i < 0) { return(ETIMEDOUT); } It's using DELAY, not tsleep. -- -Alfred Perlstein - [bright@wintelcom.net|alfred@freebsd.org] Daemon News Magazine in your snail-mail! http://magazine.daemonnews.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message