Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 22 Apr 2016 11:05:50 -0600
From:      Warner Losh <imp@bsdimp.com>
To:        John Baldwin <jhb@freebsd.org>
Cc:        Hans Petter Selasky <hps@selasky.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r298426 - head/sys/dev/fdc
Message-ID:  <6FBAFEC9-B22D-407A-A2DB-D0B37D519E57@bsdimp.com>
In-Reply-To: <4396944.pMOIsoy4We@ralph.baldwin.cx>
References:  <201604211837.u3LIbalm092252@repo.freebsd.org> <57191F7F.4010900@selasky.org> <4396944.pMOIsoy4We@ralph.baldwin.cx>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]

> On Apr 22, 2016, at 10:43 AM, John Baldwin <jhb@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


[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - https://gpgtools.org

iQIcBAEBCgAGBQJXGlnvAAoJEGwc0Sh9sBEA9vsP/RmTVZy2U/fxgYHsnR89KxF7
SdkYENBKQz0USTznb/lv/ObsYDW9RxvVhtWbeyNJ+uvGb4ghOYrnbJuHhe0XHCZ9
0zotRQSKtkBM5F0RFNz9TYjBZfd2EsqTF7Nn0AU895yGKQIl0/MfOpP2XykvuvGs
WyDKZF6mXQr5eQTjtL80EZb+StAn2rg0BwmbShrfsad6MwfcRYJ5chzliENpUc+y
ULcsfzr/Dmwpa/LnR88JHK9IqXWKNWWgm4xmiOkRUa6yJf3CKUSkhD9Eoz7CV8gg
nX+1am+yrqDJiB3W6ufE6wdWO4i0eBStnUuRJgJQfJsceNciNmIw0fv14atutV50
Ro+rEOgzSmxScuocQiU8ruxUcVPRyq5awMW05kwX4+hp3JjBmQwmo8EYB6TB0Hcn
74pNZnYKuVDqyzFpNojEwO0qmo2Y0tkg8fQO3D0e63a2/R4zQwPtk9vN0zSenB21
XaNKQjocvE5F2HZ4bRI/rbe6jntFgtNyPZ7EZDTQkymzr7TZEyxdfFTKq5f3CHwg
xnMGKZ5lGRN5WiVYDmQE9GfdZZI4y6soC6tw/7NgDl2tNfwYLW56PV1SpS5Ova5i
Mpfse1A3+IOLcz3oz2v4nRcNXHWc7D6LNXrUlOeuPjdKUrDtRcWeJr2HwhYYxOxE
7vVKLuoWLnvX7APFA2gP
=RTJj
-----END PGP SIGNATURE-----

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6FBAFEC9-B22D-407A-A2DB-D0B37D519E57>