aboutsummaryrefslogtreecommitdiff
path: root/drivers/ata/pata_it821x.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-01-25 17:08:28 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2008-01-25 17:08:28 -0800
commit2ba14a017a4ba8d2266316f481d4ad7400073d18 (patch)
tree6e86dcbbb7898eb747f1198e33961eb68bfcdb4d /drivers/ata/pata_it821x.c
parent99f1c97dbdb30e958edfd1ced0ae43df62504e07 (diff)
parenta984f58dd97f22f5113700322fed311a0ee29947 (diff)
Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev
* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev: (67 commits) fix drivers/ata/sata_fsl.c double-decl [libata] Prefer SCSI_SENSE_BUFFERSIZE to sizeof() pata_legacy: Merge winbond support ata_generic: Cenatek support pata_winbond: error return pata_serverworks: Fix cable types and cosmetics pata_mpc52xx: remove un-needed assignment libata: fix off-by-one in error categorization ahci: factor out AHCI enabling and enable AHCI before reading CAP ata_piix: implement SIDPR SCR access ata_piix: convert to prepare - activate initialization libata: factor out ata_pci_activate_sff_host() from ata_pci_one() [libata] Prefer SCSI_SENSE_BUFFERSIZE to sizeof() pata_legacy: resychronize with upstream changes and resubmit [libata] pata_legacy: typo fix [libata] pata_winbond: update for new ->data_xfer hook pata_pcmcia: convert to new data_xfer prototype libata annotations and fixes libata: use dev_driver_string() instead of "libata" in libata-sff.c ata_piix: kill unused constants and flags ...
Diffstat (limited to 'drivers/ata/pata_it821x.c')
-rw-r--r--drivers/ata/pata_it821x.c35
1 files changed, 33 insertions, 2 deletions
diff --git a/drivers/ata/pata_it821x.c b/drivers/ata/pata_it821x.c
index ca9aae09dae..109ddd42c26 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)
return ata_qc_issue_prot(qc);
}
printk(KERN_DEBUG "it821x: can't process command 0x%02X\n", qc->tf.command);
- return AC_ERR_INVALID;
+ return AC_ERR_DEV;
}
/**
@@ -516,6 +516,37 @@ static void it821x_dev_config(struct ata_device *adev)
printk("(%dK stripe)", adev->id[146]);
printk(".\n");
}
+ /* This is a controller firmware triggered funny, don't
+ report the drive faulty! */
+ adev->horkage &= ~ATA_HORKAGE_DIAGNOSTIC;
+}
+
+/**
+ * it821x_ident_hack - Hack identify data up
+ * @ap: Port
+ *
+ * Walk the devices on this firmware driven port and slightly
+ * mash the identify data to stop us and common tools trying to
+ * use features not firmware supported. The firmware itself does
+ * some masking (eg SMART) but not enough.
+ *
+ * This is a bit of an abuse of the cable method, but it is the
+ * only method called at the right time. We could modify the libata
+ * core specifically for ident hacking but while we have one offender
+ * it seems better to keep the fallout localised.
+ */
+
+static int it821x_ident_hack(struct ata_port *ap)
+{
+ struct ata_device *adev;
+ ata_link_for_each_dev(adev, &ap->link) {
+ if (ata_dev_enabled(adev)) {
+ adev->id[84] &= ~(1 << 6); /* No FUA */
+ adev->id[85] &= ~(1 << 10); /* No HPA */
+ adev->id[76] = 0; /* No NCQ/AN etc */
+ }
+ }
+ return ata_cable_unknown(ap);
}
@@ -634,7 +665,7 @@ static struct ata_port_operations it821x_smart_port_ops = {
.thaw = ata_bmdma_thaw,
.error_handler = ata_bmdma_error_handler,
.post_internal_cmd = ata_bmdma_post_internal_cmd,
- .cable_detect = ata_cable_unknown,
+ .cable_detect = it821x_ident_hack,
.bmdma_setup = ata_bmdma_setup,
.bmdma_start = ata_bmdma_start,