From 0d9172012dcfa9d8634e33394025cbc9b5fd3d96 Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Wed, 4 Feb 2004 20:38:40 -0800 Subject: [PATCH] [PATCH] fix 'cat /proc/ide//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 for help in fixing this. --- drivers/ide/ide-taskfile.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c index 72ef85b6ebf25..44dc1e03ad3e7 100644 --- a/drivers/ide/ide-taskfile.c +++ b/drivers/ide/ide-taskfile.c @@ -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; } -- 2.53.0