Commit 0d917201 authored by Bartlomiej Zolnierkiewicz's avatar Bartlomiej Zolnierkiewicz Committed by Linus Torvalds

[PATCH] fix 'cat /proc/ide/<cd|dvd>/identify' hang (CONFIG_IDE_TASKFILE=y)

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.
parent e7c4da9a
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment