diff options
Diffstat (limited to 'drivers/ata/pata_it821x.c')
-rw-r--r-- | drivers/ata/pata_it821x.c | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/drivers/ata/pata_it821x.c b/drivers/ata/pata_it821x.c index ca9aae09daed..109ddd42c266 100644 --- a/drivers/ata/pata_it821x.c +++ b/drivers/ata/pata_it821x.c | |||
@@ -430,7 +430,7 @@ static unsigned int it821x_smart_qc_issue_prot(struct ata_queued_cmd *qc) | |||
430 | return ata_qc_issue_prot(qc); | 430 | return ata_qc_issue_prot(qc); |
431 | } | 431 | } |
432 | printk(KERN_DEBUG "it821x: can't process command 0x%02X\n", qc->tf.command); | 432 | printk(KERN_DEBUG "it821x: can't process command 0x%02X\n", qc->tf.command); |
433 | return AC_ERR_INVALID; | 433 | return AC_ERR_DEV; |
434 | } | 434 | } |
435 | 435 | ||
436 | /** | 436 | /** |
@@ -516,6 +516,37 @@ static void it821x_dev_config(struct ata_device *adev) | |||
516 | printk("(%dK stripe)", adev->id[146]); | 516 | printk("(%dK stripe)", adev->id[146]); |
517 | printk(".\n"); | 517 | printk(".\n"); |
518 | } | 518 | } |
519 | /* This is a controller firmware triggered funny, don't | ||
520 | report the drive faulty! */ | ||
521 | adev->horkage &= ~ATA_HORKAGE_DIAGNOSTIC; | ||
522 | } | ||
523 | |||
524 | /** | ||
525 | * it821x_ident_hack - Hack identify data up | ||
526 | * @ap: Port | ||
527 | * | ||
528 | * Walk the devices on this firmware driven port and slightly | ||
529 | * mash the identify data to stop us and common tools trying to | ||
530 | * use features not firmware supported. The firmware itself does | ||
531 | * some masking (eg SMART) but not enough. | ||
532 | * | ||
533 | * This is a bit of an abuse of the cable method, but it is the | ||
534 | * only method called at the right time. We could modify the libata | ||
535 | * core specifically for ident hacking but while we have one offender | ||
536 | * it seems better to keep the fallout localised. | ||
537 | */ | ||
538 | |||
539 | static int it821x_ident_hack(struct ata_port *ap) | ||
540 | { | ||
541 | struct ata_device *adev; | ||
542 | ata_link_for_each_dev(adev, &ap->link) { | ||
543 | if (ata_dev_enabled(adev)) { | ||
544 | adev->id[84] &= ~(1 << 6); /* No FUA */ | ||
545 | adev->id[85] &= ~(1 << 10); /* No HPA */ | ||
546 | adev->id[76] = 0; /* No NCQ/AN etc */ | ||
547 | } | ||
548 | } | ||
549 | return ata_cable_unknown(ap); | ||
519 | } | 550 | } |
520 | 551 | ||
521 | 552 | ||
@@ -634,7 +665,7 @@ static struct ata_port_operations it821x_smart_port_ops = { | |||
634 | .thaw = ata_bmdma_thaw, | 665 | .thaw = ata_bmdma_thaw, |
635 | .error_handler = ata_bmdma_error_handler, | 666 | .error_handler = ata_bmdma_error_handler, |
636 | .post_internal_cmd = ata_bmdma_post_internal_cmd, | 667 | .post_internal_cmd = ata_bmdma_post_internal_cmd, |
637 | .cable_detect = ata_cable_unknown, | 668 | .cable_detect = it821x_ident_hack, |
638 | 669 | ||
639 | .bmdma_setup = ata_bmdma_setup, | 670 | .bmdma_setup = ata_bmdma_setup, |
640 | .bmdma_start = ata_bmdma_start, | 671 | .bmdma_start = ata_bmdma_start, |