Date: Tue, 24 Aug 2004 22:36:24 +0200 From: =?ISO-8859-1?Q?S=F8ren_Schmidt?= <sos@DeepCore.dk> To: Scott Long <scottl@FreeBSD.ORG> Cc: SXren Schmidt <sos@FreeBSD.ORG> Subject: Re: cvs commit: src/sys/dev/ata ata-chipset.c Message-ID: <412BA6C8.9010702@DeepCore.dk> In-Reply-To: <412BA3CE.3060305@freebsd.org> References: <200408242011.i7OKBQfI033557@repoman.freebsd.org> <412BA3CE.3060305@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?412BA6C8.9010702>