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.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 61c5b6e68de4..0451600bdcc6 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -976,6 +976,7 @@ static int ahci_softreset(struct ata_port *ap, unsigned int *class,
976 void __iomem *port_mmio = ahci_port_base(ap); 976 void __iomem *port_mmio = ahci_port_base(ap);
977 const u32 cmd_fis_len = 5; /* five dwords */ 977 const u32 cmd_fis_len = 5; /* five dwords */
978 const char *reason = NULL; 978 const char *reason = NULL;
979 unsigned long now, msecs;
979 struct ata_taskfile tf; 980 struct ata_taskfile tf;
980 u32 tmp; 981 u32 tmp;
981 u8 *fis; 982 u8 *fis;
@@ -1016,6 +1017,11 @@ static int ahci_softreset(struct ata_port *ap, unsigned int *class,
1016 fis = pp->cmd_tbl; 1017 fis = pp->cmd_tbl;
1017 1018
1018 /* issue the first D2H Register FIS */ 1019 /* issue the first D2H Register FIS */
1020 msecs = 0;
1021 now = jiffies;
1022 if (time_after(now, deadline))
1023 msecs = jiffies_to_msecs(deadline - now);
1024
1019 ahci_fill_cmd_slot(pp, 0, 1025 ahci_fill_cmd_slot(pp, 0,
1020 cmd_fis_len | AHCI_CMD_RESET | AHCI_CMD_CLR_BUSY); 1026 cmd_fis_len | AHCI_CMD_RESET | AHCI_CMD_CLR_BUSY);
1021 1027
@@ -1024,7 +1030,7 @@ static int ahci_softreset(struct ata_port *ap, unsigned int *class,
1024 1030
1025 writel(1, port_mmio + PORT_CMD_ISSUE); 1031 writel(1, port_mmio + PORT_CMD_ISSUE);
1026 1032
1027 tmp = ata_wait_register(port_mmio + PORT_CMD_ISSUE, 0x1, 0x1, 1, 500); 1033 tmp = ata_wait_register(port_mmio + PORT_CMD_ISSUE, 0x1, 0x1, 1, msecs);
1028 if (tmp & 0x1) { 1034 if (tmp & 0x1) {
1029 rc = -EIO; 1035 rc = -EIO;
1030 reason = "1st FIS failed"; 1036 reason = "1st FIS failed";