Date: Sat, 11 May 2002 08:23:53 +0200 From: Joerg Wunsch <j@uriah.heep.sax.de> To: Brian Somers <brian@Awfulhak.org> Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/isa fd.c fdreg.h Message-ID: <20020511082352.E91528@uriah.heep.sax.de> In-Reply-To: <200205110015.g4B0F8nA006576@hak.lan.Awfulhak.org>; from brian@Awfulhak.org on Sat, May 11, 2002 at 01:15:08AM %2B0100 References: <joerg@FreeBSD.org> <200205110015.g4B0F8nA006576@hak.lan.Awfulhak.org>
next in thread | previous in thread | raw e-mail | index | archive | help
As Brian Somers wrote: > As fdc is also a module, would it be better to call tsleep() instead > of delay if (!cold) ? Like in sys/dev/digi/digi.c:digi_delay()... Hmm, tsleep() is much less granular than DELAY() (hz == usually 100 vs. microseconds == 1000000 per second). DELAY() used to be only available in the (cold) case in the past, but after reviewing the function now, it didn't seem to be unsafe to use in the (!cold) case to me now. (The man page for DELAY(9) doesn't mention any restriction either.) Remember, this is a tight PIO loop (similar to PIO mode in the ATA driver for example), where the expectation is that the condition we are spinning for will actually become available very soon. Obviously, for most controller chips, "very soon" used to be "within 100000 cycles of a CPU integer register countdown" until now, while the Natsemi chips in some Compaq machines fail this, and take a bit longer. Starting a tsleep() for each single IO to the FDC is IMHO too much heavy-weighted. Note also that we don't need to be too much MI here since the underlying hardware is restricted to machines with an ISA bus, so in addition to IA32, it'll only apply to the Alpha arch. If i read the code correctly, the !SIMOS Alpha machines should have no problem, while for the SIMOS machines DELAY() is a no-op. Hmm, the only chance i see to cover this is to drastically increase the FDSTS_TIMEOUT value in the SIMOS case (in fdreg.h), effectively falling back to the old counted spin-loop solution but now with at least one function call overhead in the loop (which i have no idea how long it would take to execute on SIMOS Alpha hardware). I would love it if we could make up our minds quickly enough whether the current version is acceptable for -stable, since it's also the decision whether 4.6R will have a working floppy driver on those Compaq machines mentioned in kern/21397 or not. -stable doesn't have a loadable fdc module anyway. Btw., my (not-so)-current machine here /is/ using the fdc KLD, so i have automatically tested the implementation there. I haven't observed any abnormal behaviour with using DELAY(). Note that those PIO loops are used throughout the entire lifetime of the system, not only during device probing, so the question of whether it's available as KLD is IMHO irrelevant. -- cheers, J"org .-.-. --... ...-- -.. . DL8DTL http://www.sax.de/~joerg/ NIC: JW11-RIPE Never trust an operating system you don't have sources for. ;-) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020511082352.E91528>