aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/ahci.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-29 15:11:54 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-29 15:11:54 -0400
commit00cda56d39f013cce60f44f1e3da19b87eba5d85 (patch)
tree2cfe7bf556562a846ff46a558a31ca1939d2e12c /drivers/ata/ahci.c
parentda8e5aa21e037be02e0752e80b9444ff60185a3f (diff)
parentab6fc95f609b372a19e18ea689986846ab1ba29c (diff)
Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev
* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev: [libata] AHCI: fix newly introduced host-reset bug [libata] sata_nv: fix SWNCQ enabling libata: add MAXTOR 7V300F0/VA111900 to NCQ blacklist libata: no need to speed down if already at PIO0 libata: relocate forcing PIO0 on reset pata_ns87415: define SUPERIO_IDE_MAX_RETRIES [libata] Address some checkpatch-spotted issues [libata] fix 'if(' and similar areas that lack whitespace libata: implement ata_wait_after_reset() libata: track SLEEP state and issue SRST to wake it up libata: relocate and fix post-command processing
Diffstat (limited to 'drivers/ata/ahci.c')
-rw-r--r--drivers/ata/ahci.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 49cf4cf1a5a2..c8ab947cf359 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -898,8 +898,10 @@ static int ahci_reset_controller(struct ata_host *host)
898 * AHCI-specific, such as HOST_RESET. 898 * AHCI-specific, such as HOST_RESET.
899 */ 899 */
900 tmp = readl(mmio + HOST_CTL); 900 tmp = readl(mmio + HOST_CTL);
901 if (!(tmp & HOST_AHCI_EN)) 901 if (!(tmp & HOST_AHCI_EN)) {
902 writel(tmp | HOST_AHCI_EN, mmio + HOST_CTL); 902 tmp |= HOST_AHCI_EN;
903 writel(tmp, mmio + HOST_CTL);
904 }
903 905
904 /* global controller reset */ 906 /* global controller reset */
905 if ((tmp & HOST_RESET) == 0) { 907 if ((tmp & HOST_RESET) == 0) {
@@ -1153,15 +1155,8 @@ static int ahci_do_softreset(struct ata_link *link, unsigned int *class,
1153 tf.ctl &= ~ATA_SRST; 1155 tf.ctl &= ~ATA_SRST;
1154 ahci_exec_polled_cmd(ap, pmp, &tf, 0, 0, 0); 1156 ahci_exec_polled_cmd(ap, pmp, &tf, 0, 0, 0);
1155 1157
1156 /* spec mandates ">= 2ms" before checking status. 1158 /* wait a while before checking status */
1157 * We wait 150ms, because that was the magic delay used for 1159 ata_wait_after_reset(ap, deadline);
1158 * ATAPI devices in Hale Landis's ATADRVR, for the period of time
1159 * between when the ATA command register is written, and then
1160 * status is checked. Because waiting for "a while" before
1161 * checking status is fine, post SRST, we perform this magic
1162 * delay here as well.
1163 */
1164 msleep(150);
1165 1160
1166 rc = ata_wait_ready(ap, deadline); 1161 rc = ata_wait_ready(ap, deadline);
1167 /* link occupied, -ENODEV too is an error */ 1162 /* link occupied, -ENODEV too is an error */