diff options
| author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-03-24 18:22:55 -0400 |
|---|---|---|
| committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-03-24 18:22:55 -0400 |
| commit | 62bd0441a60b0499db339b3dc1be039f8ed9fd35 (patch) | |
| tree | 8704e305e665bb8aee277f6e408b2195b52f4db9 | |
| parent | 2f40c9b0b65b5635e2e13dfa068bd56fe7a8ff98 (diff) | |
ide: propagate AltStatus workarounds to ide_driveid_update()
Propagate AltStatus workarounds from try_to_identify()
to ide_driveid_update().
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
| -rw-r--r-- | drivers/ide/ide-iops.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c index a955483d2404..944cd857c90a 100644 --- a/drivers/ide/ide-iops.c +++ b/drivers/ide/ide-iops.c | |||
| @@ -293,8 +293,8 @@ int ide_driveid_update(ide_drive_t *drive) | |||
| 293 | const struct ide_tp_ops *tp_ops = hwif->tp_ops; | 293 | const struct ide_tp_ops *tp_ops = hwif->tp_ops; |
| 294 | u16 *id; | 294 | u16 *id; |
| 295 | unsigned long flags; | 295 | unsigned long flags; |
| 296 | int rc; | 296 | int use_altstatus = 0, rc; |
| 297 | u8 uninitialized_var(s); | 297 | u8 a, uninitialized_var(s); |
| 298 | 298 | ||
| 299 | id = kmalloc(SECTOR_SIZE, GFP_ATOMIC); | 299 | id = kmalloc(SECTOR_SIZE, GFP_ATOMIC); |
| 300 | if (id == NULL) | 300 | if (id == NULL) |
| @@ -308,9 +308,24 @@ int ide_driveid_update(ide_drive_t *drive) | |||
| 308 | SELECT_MASK(drive, 1); | 308 | SELECT_MASK(drive, 1); |
| 309 | tp_ops->set_irq(hwif, 0); | 309 | tp_ops->set_irq(hwif, 0); |
| 310 | msleep(50); | 310 | msleep(50); |
| 311 | |||
| 312 | if (hwif->io_ports.ctl_addr && | ||
| 313 | (hwif->host_flags & IDE_HFLAG_BROKEN_ALTSTATUS) == 0) { | ||
| 314 | a = tp_ops->read_altstatus(hwif); | ||
| 315 | s = tp_ops->read_status(hwif); | ||
| 316 | if ((a ^ s) & ~ATA_IDX) | ||
| 317 | /* ancient Seagate drives, broken interfaces */ | ||
| 318 | printk(KERN_INFO "%s: probing with STATUS(0x%02x) " | ||
| 319 | "instead of ALTSTATUS(0x%02x)\n", | ||
| 320 | drive->name, s, a); | ||
| 321 | else | ||
| 322 | /* use non-intrusive polling */ | ||
| 323 | use_altstatus = 1; | ||
| 324 | } | ||
| 325 | |||
| 311 | tp_ops->exec_command(hwif, ATA_CMD_ID_ATA); | 326 | tp_ops->exec_command(hwif, ATA_CMD_ID_ATA); |
| 312 | 327 | ||
| 313 | if (ide_busy_sleep(hwif, WAIT_WORSTCASE, 1)) { | 328 | if (ide_busy_sleep(hwif, WAIT_WORSTCASE, use_altstatus)) { |
| 314 | rc = 1; | 329 | rc = 1; |
| 315 | goto out_err; | 330 | goto out_err; |
| 316 | } | 331 | } |
