From owner-cvs-src@FreeBSD.ORG Tue Aug 24 20:36:52 2004 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BF2A916A4CE; Tue, 24 Aug 2004 20:36:52 +0000 (GMT) Received: from spider.deepcore.dk (cpe.atm2-0-53484.0x50a6c9a6.abnxx9.customer.tele.dk [80.166.201.166]) by mx1.FreeBSD.org (Postfix) with ESMTP id 000CA43D53; Tue, 24 Aug 2004 20:36:51 +0000 (GMT) (envelope-from sos@DeepCore.dk) Received: from [194.192.25.143] (laptop.deepcore.dk [194.192.25.143]) by spider.deepcore.dk (8.12.11/8.12.10) with ESMTP id i7OKao4u030900; Tue, 24 Aug 2004 22:36:50 +0200 (CEST) (envelope-from sos@DeepCore.dk) Message-ID: <412BA6C8.9010702@DeepCore.dk> Date: Tue, 24 Aug 2004 22:36:24 +0200 From: =?ISO-8859-1?Q?S=F8ren_Schmidt?= User-Agent: Mozilla Thunderbird 0.7.2 (X11/20040802) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Scott Long References: <200408242011.i7OKBQfI033557@repoman.freebsd.org> <412BA3CE.3060305@freebsd.org> In-Reply-To: <412BA3CE.3060305@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable cc: cvs-src@FreeBSD.ORG cc: src-committers@FreeBSD.ORG cc: cvs-all@FreeBSD.ORG cc: SXren Schmidt Subject: Re: cvs commit: src/sys/dev/ata ata-chipset.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Aug 2004 20:36:53 -0000 Scott Long wrote: > SXren Schmidt wrote: >=20 >> sos 2004-08-24 20:11:26 UTC >> >> FreeBSD src repository >> >> Modified files: >> sys/dev/ata ata-chipset.c Log: >> Sii_reset needs to wait up to 1 second to get slow disks with it so >> use tsleep instead of DELAY. >> Revision Changes Path >> 1.82 +1 -1 src/sys/dev/ata/ata-chipset.c >=20 >=20 > I'm having a hard time following the code here, but it looks like > ch->hw.reset() can get called with a mutex held, yes? hw.reset() will > in turn wind up calling ctrl->reset(), which will call sii_reset() in > the sii case. That means that the tsleep() can get called with a > mutex held. This is probably not what you want. Also, if you are > expecting the ctrl->reset() to work correctly before interrupts are > enabled, you should be aware that tsleep and msleep will return > immediately instead of sleeping in this case. Only DELAY() is safe > (relatively) to use at boot before interrupts are enabled. The path were the delay is needed is first used when interrupts are=20 enabled so that part should be safe. I shouldn't be calling hw.reset=20 with a mutex held AFAIK. Anyhow what I need is just a way to wait ~1 sec without busyspinning the = CPU as DELAY does (or has that been changed ?). -S=F8ren