Use tsleep in the low level delay functions called when resetting
authorMatthew Dillon <dillon@apollo.backplane.com>
Fri, 26 Dec 2008 18:41:37 +0000 (10:41 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Fri, 26 Dec 2008 18:41:37 +0000 (10:41 -0800)
nata ports.

Submitted-by: Dmitry Komissaroff <dxi@mail.ru>
sys/dev/disk/nata/ata-all.c

index 50d6622..1144e23 100644 (file)
@@ -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 *