aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/ahci.c
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2007-07-16 01:29:39 -0400
committerJeff Garzik <jeff@garzik.org>2007-07-20 08:02:10 -0400
commita9cf5e858100b2f82ad61028c26a1a3de11c4839 (patch)
tree3edaf851bc132d6b8e7ea6cd09eb7ca80156bde0 /drivers/ata/ahci.c
parent91c4a2e09267b0ddc8e59d121e3748cd18675739 (diff)
ahci: separate out ahci_do_softreset()
Separate out ahci_do_softreset() which takes @pmp as its last argument. This will be used to implement ahci_pmp_softreset(). Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/ata/ahci.c')
-rw-r--r--drivers/ata/ahci.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index db65f4a16021..c5034d450c62 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -1023,8 +1023,8 @@ static int ahci_exec_polled_cmd(struct ata_port *ap, int pmp,
1023 return 0; 1023 return 0;
1024} 1024}
1025 1025
1026static int ahci_softreset(struct ata_port *ap, unsigned int *class, 1026static int ahci_do_softreset(struct ata_port *ap, unsigned int *class,
1027 unsigned long deadline) 1027 int pmp, unsigned long deadline)
1028{ 1028{
1029 const char *reason = NULL; 1029 const char *reason = NULL;
1030 unsigned long now, msecs; 1030 unsigned long now, msecs;
@@ -1054,7 +1054,7 @@ static int ahci_softreset(struct ata_port *ap, unsigned int *class,
1054 msecs = jiffies_to_msecs(deadline - now); 1054 msecs = jiffies_to_msecs(deadline - now);
1055 1055
1056 tf.ctl |= ATA_SRST; 1056 tf.ctl |= ATA_SRST;
1057 if (ahci_exec_polled_cmd(ap, 0, &tf, 0, 1057 if (ahci_exec_polled_cmd(ap, pmp, &tf, 0,
1058 AHCI_CMD_RESET | AHCI_CMD_CLR_BUSY, msecs)) { 1058 AHCI_CMD_RESET | AHCI_CMD_CLR_BUSY, msecs)) {
1059 rc = -EIO; 1059 rc = -EIO;
1060 reason = "1st FIS failed"; 1060 reason = "1st FIS failed";
@@ -1066,7 +1066,7 @@ static int ahci_softreset(struct ata_port *ap, unsigned int *class,
1066 1066
1067 /* issue the second D2H Register FIS */ 1067 /* issue the second D2H Register FIS */
1068 tf.ctl &= ~ATA_SRST; 1068 tf.ctl &= ~ATA_SRST;
1069 ahci_exec_polled_cmd(ap, 0, &tf, 0, 0, 0); 1069 ahci_exec_polled_cmd(ap, pmp, &tf, 0, 0, 0);
1070 1070
1071 /* spec mandates ">= 2ms" before checking status. 1071 /* spec mandates ">= 2ms" before checking status.
1072 * We wait 150ms, because that was the magic delay used for 1072 * We wait 150ms, because that was the magic delay used for
@@ -1094,6 +1094,12 @@ static int ahci_softreset(struct ata_port *ap, unsigned int *class,
1094 return rc; 1094 return rc;
1095} 1095}
1096 1096
1097static int ahci_softreset(struct ata_port *ap, unsigned int *class,
1098 unsigned long deadline)
1099{
1100 return ahci_do_softreset(ap, class, 0, deadline);
1101}
1102
1097static int ahci_hardreset(struct ata_port *ap, unsigned int *class, 1103static int ahci_hardreset(struct ata_port *ap, unsigned int *class,
1098 unsigned long deadline) 1104 unsigned long deadline)
1099{ 1105{