diff options
-rw-r--r-- | drivers/ata/libata-core.c | 19 | ||||
-rw-r--r-- | include/linux/libata.h | 6 |
2 files changed, 23 insertions, 2 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index e85c2f8cf193..753b0152afd1 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
@@ -616,8 +616,11 @@ ata_dev_try_classify(struct ata_port *ap, unsigned int device, u8 *r_err) | |||
616 | if (r_err) | 616 | if (r_err) |
617 | *r_err = err; | 617 | *r_err = err; |
618 | 618 | ||
619 | /* see if device passed diags */ | 619 | /* see if device passed diags: if master then continue and warn later */ |
620 | if (err == 1) | 620 | if (err == 0 && device == 0) |
621 | /* diagnostic fail : do nothing _YET_ */ | ||
622 | ap->device[device].horkage |= ATA_HORKAGE_DIAGNOSTIC; | ||
623 | else if (err == 1) | ||
621 | /* do nothing */ ; | 624 | /* do nothing */ ; |
622 | else if ((device == 0) && (err == 0x81)) | 625 | else if ((device == 0) && (err == 0x81)) |
623 | /* do nothing */ ; | 626 | /* do nothing */ ; |
@@ -1523,6 +1526,18 @@ int ata_dev_configure(struct ata_device *dev, int print_info) | |||
1523 | cdb_intr_string); | 1526 | cdb_intr_string); |
1524 | } | 1527 | } |
1525 | 1528 | ||
1529 | if (dev->horkage & ATA_HORKAGE_DIAGNOSTIC) { | ||
1530 | /* Let the user know. We don't want to disallow opens for | ||
1531 | rescue purposes, or in case the vendor is just a blithering | ||
1532 | idiot */ | ||
1533 | if (print_info) { | ||
1534 | ata_dev_printk(dev, KERN_WARNING, | ||
1535 | "Drive reports diagnostics failure. This may indicate a drive\n"); | ||
1536 | ata_dev_printk(dev, KERN_WARNING, | ||
1537 | "fault or invalid emulation. Contact drive vendor for information.\n"); | ||
1538 | } | ||
1539 | } | ||
1540 | |||
1526 | ata_set_port_max_cmd_len(ap); | 1541 | ata_set_port_max_cmd_len(ap); |
1527 | 1542 | ||
1528 | /* limit bridge transfers to udma5, 200 sectors */ | 1543 | /* limit bridge transfers to udma5, 200 sectors */ |
diff --git a/include/linux/libata.h b/include/linux/libata.h index ff67e7524fe9..1ef3d3901b47 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -289,6 +289,11 @@ enum { | |||
289 | * most devices. | 289 | * most devices. |
290 | */ | 290 | */ |
291 | ATA_SPINUP_WAIT = 8000, | 291 | ATA_SPINUP_WAIT = 8000, |
292 | |||
293 | /* Horkage types. May be set by libata or controller on drives | ||
294 | (some horkage may be drive/controller pair dependant */ | ||
295 | |||
296 | ATA_HORKAGE_DIAGNOSTIC = (1 << 0), /* Failed boot diag */ | ||
292 | }; | 297 | }; |
293 | 298 | ||
294 | enum hsm_task_states { | 299 | enum hsm_task_states { |
@@ -476,6 +481,7 @@ struct ata_device { | |||
476 | 481 | ||
477 | /* error history */ | 482 | /* error history */ |
478 | struct ata_ering ering; | 483 | struct ata_ering ering; |
484 | unsigned int horkage; /* List of broken features */ | ||
479 | }; | 485 | }; |
480 | 486 | ||
481 | /* Offset into struct ata_device. Fields above it are maintained | 487 | /* Offset into struct ata_device. Fields above it are maintained |