svn commit: r298426 - head/sys/dev/fdc

Warner Losh imp at bsdimp.com
Fri Apr 22 17:05:54 UTC 2016


> On Apr 22, 2016, at 10:43 AM, John Baldwin <jhb at freebsd.org> wrote:
> 
> On Thursday, April 21, 2016 08:44:15 PM Hans Petter Selasky wrote:
>> On 04/21/16 20:37, John Baldwin wrote:
>>> -		tsleep(fdc, PRIBIO, "fdcrst", hz);
>>> +		if (cold)
>>> +			DELAY(1000000);
>>> +		else
>>> +			tsleep(fdc, PRIBIO, "fdcrst", hz);
>> 
>> Hi,
>> 
>> pause() and pause_sbt() does exactly this, checking for "cold" and using
>> DELAY().
> 
> Yes, I know.  In theory though the driver interrupt could fire during
> normal operation aborting the sleep, so the wait channel for the !cold
> case is actually there for a reason it seems.  (That is, in the !cold case
> the driver might terminate the sleep early which you can't do with pause.)

Most of the sleeps in the fdc driver are more of a timeout waiting for the
interrupt to fire sorts of things. Post an action to the drive, and tsleep for
a second or until that action is done and you can get on with the next thing.

I’ll admit to being lazy and not checking this specific one, but it’s a general
design pattern in this driver...

Warner

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 842 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.freebsd.org/pipermail/svn-src-head/attachments/20160422/9aaee710/attachment.sig>


More information about the svn-src-head mailing list