aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/ide/ide-probe.c9
-rw-r--r--include/linux/ide.h2
2 files changed, 7 insertions, 4 deletions
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c
index 7f264ed1141b..c895ed52b2e8 100644
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -295,7 +295,7 @@ int ide_dev_read_id(ide_drive_t *drive, u8 cmd, u16 *id)
295 295
296 timeout = ((cmd == ATA_CMD_ID_ATA) ? WAIT_WORSTCASE : WAIT_PIDENTIFY) / 2; 296 timeout = ((cmd == ATA_CMD_ID_ATA) ? WAIT_WORSTCASE : WAIT_PIDENTIFY) / 2;
297 297
298 if (ide_busy_sleep(hwif, timeout, use_altstatus)) 298 if (ide_busy_sleep(drive, timeout, use_altstatus))
299 return 1; 299 return 1;
300 300
301 /* wait for IRQ and ATA_DRQ */ 301 /* wait for IRQ and ATA_DRQ */
@@ -316,8 +316,9 @@ int ide_dev_read_id(ide_drive_t *drive, u8 cmd, u16 *id)
316 return rc; 316 return rc;
317} 317}
318 318
319int ide_busy_sleep(ide_hwif_t *hwif, unsigned long timeout, int altstatus) 319int ide_busy_sleep(ide_drive_t *drive, unsigned long timeout, int altstatus)
320{ 320{
321 ide_hwif_t *hwif = drive->hwif;
321 u8 stat; 322 u8 stat;
322 323
323 timeout += jiffies; 324 timeout += jiffies;
@@ -330,6 +331,8 @@ int ide_busy_sleep(ide_hwif_t *hwif, unsigned long timeout, int altstatus)
330 return 0; 331 return 0;
331 } while (time_before(jiffies, timeout)); 332 } while (time_before(jiffies, timeout));
332 333
334 printk(KERN_ERR "%s: timeout in %s\n", drive->name, __func__);
335
333 return 1; /* drive timed-out */ 336 return 1; /* drive timed-out */
334} 337}
335 338
@@ -420,7 +423,7 @@ static int do_probe (ide_drive_t *drive, u8 cmd)
420 tp_ops->dev_select(drive); 423 tp_ops->dev_select(drive);
421 msleep(50); 424 msleep(50);
422 tp_ops->exec_command(hwif, ATA_CMD_DEV_RESET); 425 tp_ops->exec_command(hwif, ATA_CMD_DEV_RESET);
423 (void)ide_busy_sleep(hwif, WAIT_WORSTCASE, 0); 426 (void)ide_busy_sleep(drive, WAIT_WORSTCASE, 0);
424 rc = ide_dev_read_id(drive, cmd, id); 427 rc = ide_dev_read_id(drive, cmd, id);
425 } 428 }
426 429
diff --git a/include/linux/ide.h b/include/linux/ide.h
index ff65fffb078f..9fed365a598b 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -1109,7 +1109,7 @@ void ide_fix_driveid(u16 *);
1109 1109
1110extern void ide_fixstring(u8 *, const int, const int); 1110extern void ide_fixstring(u8 *, const int, const int);
1111 1111
1112int ide_busy_sleep(ide_hwif_t *, unsigned long, int); 1112int ide_busy_sleep(ide_drive_t *, unsigned long, int);
1113 1113
1114int ide_wait_stat(ide_startstop_t *, ide_drive_t *, u8, u8, unsigned long); 1114int ide_wait_stat(ide_startstop_t *, ide_drive_t *, u8, u8, unsigned long);
1115 1115