aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/ahci.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ata/ahci.c')
-rw-r--r--drivers/ata/ahci.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 34c5534ed64c..0319f10d42d5 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -874,7 +874,8 @@ static int ahci_clo(struct ata_port *ap)
874 return 0; 874 return 0;
875} 875}
876 876
877static int ahci_softreset(struct ata_port *ap, unsigned int *class) 877static int ahci_softreset(struct ata_port *ap, unsigned int *class,
878 unsigned long deadline)
878{ 879{
879 struct ahci_port_priv *pp = ap->private_data; 880 struct ahci_port_priv *pp = ap->private_data;
880 void __iomem *port_mmio = ahci_port_base(ap); 881 void __iomem *port_mmio = ahci_port_base(ap);
@@ -961,8 +962,8 @@ static int ahci_softreset(struct ata_port *ap, unsigned int *class)
961 962
962 *class = ATA_DEV_NONE; 963 *class = ATA_DEV_NONE;
963 if (ata_port_online(ap)) { 964 if (ata_port_online(ap)) {
964 if (ata_busy_sleep(ap, ATA_TMOUT_BOOT_QUICK, ATA_TMOUT_BOOT)) { 965 rc = ata_wait_ready(ap, deadline);
965 rc = -EIO; 966 if (rc && rc != -ENODEV) {
966 reason = "device not ready"; 967 reason = "device not ready";
967 goto fail; 968 goto fail;
968 } 969 }
@@ -979,7 +980,8 @@ static int ahci_softreset(struct ata_port *ap, unsigned int *class)
979 return rc; 980 return rc;
980} 981}
981 982
982static int ahci_hardreset(struct ata_port *ap, unsigned int *class) 983static int ahci_hardreset(struct ata_port *ap, unsigned int *class,
984 unsigned long deadline)
983{ 985{
984 struct ahci_port_priv *pp = ap->private_data; 986 struct ahci_port_priv *pp = ap->private_data;
985 u8 *d2h_fis = pp->rx_fis + RX_FIS_D2H_REG; 987 u8 *d2h_fis = pp->rx_fis + RX_FIS_D2H_REG;
@@ -995,7 +997,7 @@ static int ahci_hardreset(struct ata_port *ap, unsigned int *class)
995 tf.command = 0x80; 997 tf.command = 0x80;
996 ata_tf_to_fis(&tf, d2h_fis, 0); 998 ata_tf_to_fis(&tf, d2h_fis, 0);
997 999
998 rc = sata_std_hardreset(ap, class); 1000 rc = sata_std_hardreset(ap, class, deadline);
999 1001
1000 ahci_start_engine(ap); 1002 ahci_start_engine(ap);
1001 1003
@@ -1008,7 +1010,8 @@ static int ahci_hardreset(struct ata_port *ap, unsigned int *class)
1008 return rc; 1010 return rc;
1009} 1011}
1010 1012
1011static int ahci_vt8251_hardreset(struct ata_port *ap, unsigned int *class) 1013static int ahci_vt8251_hardreset(struct ata_port *ap, unsigned int *class,
1014 unsigned long deadline)
1012{ 1015{
1013 int rc; 1016 int rc;
1014 1017
@@ -1016,7 +1019,8 @@ static int ahci_vt8251_hardreset(struct ata_port *ap, unsigned int *class)
1016 1019
1017 ahci_stop_engine(ap); 1020 ahci_stop_engine(ap);
1018 1021
1019 rc = sata_port_hardreset(ap, sata_ehc_deb_timing(&ap->eh_context)); 1022 rc = sata_port_hardreset(ap, sata_ehc_deb_timing(&ap->eh_context),
1023 deadline);
1020 1024
1021 /* vt8251 needs SError cleared for the port to operate */ 1025 /* vt8251 needs SError cleared for the port to operate */
1022 ahci_scr_write(ap, SCR_ERROR, ahci_scr_read(ap, SCR_ERROR)); 1026 ahci_scr_write(ap, SCR_ERROR, ahci_scr_read(ap, SCR_ERROR));