From 6e40a325330cda5dbc56614ea592a8fbd4a4b900 Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Fri, 26 Dec 2008 10:41:37 -0800 Subject: [PATCH] Use tsleep in the low level delay functions called when resetting nata ports. Submitted-by: Dmitry Komissaroff --- sys/dev/disk/nata/ata-all.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/sys/dev/disk/nata/ata-all.c b/sys/dev/disk/nata/ata-all.c index 50d6622cca..1144e23005 100644 --- a/sys/dev/disk/nata/ata-all.c +++ b/sys/dev/disk/nata/ata-all.c @@ -825,12 +825,16 @@ ata_modify_if_48bit(struct ata_request *request) void ata_udelay(int interval) { - /* for now just use DELAY, the timer/sleep subsytems are not there yet */ - /* XXX use DRIVERSLEEP if possible */ - if (1 || interval < (1000000/hz)) + /* + * Use tsleep now. Theoretically calls to this function are only made + * in non-time-critical code paths, i.e. the ata reset code. + */ +#if 0 + if (interval < (1000000/hz)) DELAY(interval); else - tsleep(&interval, 0, "ataslp", interval/(1000000/hz)); +#endif + tsleep(&interval, 0, "ataslp", 1 + interval / (1000000 / hz)); } char * -- 2.41.0