]> git.hungrycats.org Git - linux/commitdiff
[PATCH] fix 'cat /proc/ide/<cd|dvd>/identify' hang (CONFIG_IDE_TASKFILE=y)
authorBartlomiej Zolnierkiewicz <b.zolnierkiewicz@elka.pw.edu.pl>
Thu, 5 Feb 2004 04:38:40 +0000 (20:38 -0800)
committerLinus Torvalds <torvalds@home.osdl.org>
Thu, 5 Feb 2004 04:38:40 +0000 (20:38 -0800)
Some devices need more time to become non-busy after command completion,
so use the same timeout in wait_drive_not_busy() (called from task_in_intr()
if CONFIG_IDE_TASKFILE_IO=y) as in drive_cmd_intr().

Thanks to Mark Haverkamp <markh@osdl.org> for help in fixing this.

drivers/ide/ide-taskfile.c

index 72ef85b6ebf25d9d202283c45418f3c63f582d71..44dc1e03ad3e76b5180786e889e00924c7e271a2 100644 (file)
@@ -772,14 +772,20 @@ EXPORT_SYMBOL(task_mulout_intr);
 static u8 wait_drive_not_busy(ide_drive_t *drive)
 {
        ide_hwif_t *hwif = HWIF(drive);
-       int retries = 5;
+       int retries = 100;
        u8 stat;
+
        /*
-        * (ks) Last sector was transfered, wait until drive is ready.
-        * This can take up to 10 usec. We willl wait max 50 us.
+        * Last sector was transfered, wait until drive is ready.
+        * This can take up to 10 usec, but we will wait max 1 ms
+        * (drive_cmd_intr() waits that long).
         */
        while (((stat = hwif->INB(IDE_STATUS_REG)) & BUSY_STAT) && retries--)
                udelay(10);
+
+       if (!retries)
+               printk(KERN_ERR "%s: drive still BUSY!\n", drive->name);
+
        return stat;
 }