diff options
author | Tejun Heo <tj@kernel.org> | 2010-09-06 11:56:29 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2010-10-21 20:21:05 -0400 |
commit | 97750cebb3000a9cc08f8ce8dc8c7143be7d7201 (patch) | |
tree | 04220b8a8ed3f353e3e0023805b32e7d746dc6f3 /drivers/ata/libahci.c | |
parent | a97c40068fab5d85c4241451fc312cb9025d7e6c (diff) |
libata: add @ap to ata_wait_register() and introduce ata_msleep()
Add optional @ap argument to ata_wait_register() and replace msleep()
calls with ata_msleep() which take optional @ap in addition to the
duration. These will be used to implement EH exclusion.
This patch doesn't cause any behavior difference.
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/ata/libahci.c')
-rw-r--r-- | drivers/ata/libahci.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c index 437f92597788..524dbe8be163 100644 --- a/drivers/ata/libahci.c +++ b/drivers/ata/libahci.c | |||
@@ -567,7 +567,7 @@ int ahci_stop_engine(struct ata_port *ap) | |||
567 | writel(tmp, port_mmio + PORT_CMD); | 567 | writel(tmp, port_mmio + PORT_CMD); |
568 | 568 | ||
569 | /* wait for engine to stop. This could be as long as 500 msec */ | 569 | /* wait for engine to stop. This could be as long as 500 msec */ |
570 | tmp = ata_wait_register(port_mmio + PORT_CMD, | 570 | tmp = ata_wait_register(ap, port_mmio + PORT_CMD, |
571 | PORT_CMD_LIST_ON, PORT_CMD_LIST_ON, 1, 500); | 571 | PORT_CMD_LIST_ON, PORT_CMD_LIST_ON, 1, 500); |
572 | if (tmp & PORT_CMD_LIST_ON) | 572 | if (tmp & PORT_CMD_LIST_ON) |
573 | return -EIO; | 573 | return -EIO; |
@@ -614,7 +614,7 @@ static int ahci_stop_fis_rx(struct ata_port *ap) | |||
614 | writel(tmp, port_mmio + PORT_CMD); | 614 | writel(tmp, port_mmio + PORT_CMD); |
615 | 615 | ||
616 | /* wait for completion, spec says 500ms, give it 1000 */ | 616 | /* wait for completion, spec says 500ms, give it 1000 */ |
617 | tmp = ata_wait_register(port_mmio + PORT_CMD, PORT_CMD_FIS_ON, | 617 | tmp = ata_wait_register(ap, port_mmio + PORT_CMD, PORT_CMD_FIS_ON, |
618 | PORT_CMD_FIS_ON, 10, 1000); | 618 | PORT_CMD_FIS_ON, 10, 1000); |
619 | if (tmp & PORT_CMD_FIS_ON) | 619 | if (tmp & PORT_CMD_FIS_ON) |
620 | return -EBUSY; | 620 | return -EBUSY; |
@@ -671,7 +671,7 @@ static int ahci_set_lpm(struct ata_link *link, enum ata_lpm_policy policy, | |||
671 | readl(port_mmio + PORT_CMD); | 671 | readl(port_mmio + PORT_CMD); |
672 | 672 | ||
673 | /* wait 10ms to be sure we've come out of LPM state */ | 673 | /* wait 10ms to be sure we've come out of LPM state */ |
674 | msleep(10); | 674 | ata_msleep(ap, 10); |
675 | } else { | 675 | } else { |
676 | cmd |= PORT_CMD_ALPE; | 676 | cmd |= PORT_CMD_ALPE; |
677 | if (policy == ATA_LPM_MIN_POWER) | 677 | if (policy == ATA_LPM_MIN_POWER) |
@@ -740,7 +740,7 @@ static void ahci_start_port(struct ata_port *ap) | |||
740 | emp->led_state, | 740 | emp->led_state, |
741 | 4); | 741 | 4); |
742 | if (rc == -EBUSY) | 742 | if (rc == -EBUSY) |
743 | msleep(1); | 743 | ata_msleep(ap, 1); |
744 | else | 744 | else |
745 | break; | 745 | break; |
746 | } | 746 | } |
@@ -799,7 +799,7 @@ int ahci_reset_controller(struct ata_host *host) | |||
799 | * reset must complete within 1 second, or | 799 | * reset must complete within 1 second, or |
800 | * the hardware should be considered fried. | 800 | * the hardware should be considered fried. |
801 | */ | 801 | */ |
802 | tmp = ata_wait_register(mmio + HOST_CTL, HOST_RESET, | 802 | tmp = ata_wait_register(NULL, mmio + HOST_CTL, HOST_RESET, |
803 | HOST_RESET, 10, 1000); | 803 | HOST_RESET, 10, 1000); |
804 | 804 | ||
805 | if (tmp & HOST_RESET) { | 805 | if (tmp & HOST_RESET) { |
@@ -1179,7 +1179,7 @@ int ahci_kick_engine(struct ata_port *ap) | |||
1179 | writel(tmp, port_mmio + PORT_CMD); | 1179 | writel(tmp, port_mmio + PORT_CMD); |
1180 | 1180 | ||
1181 | rc = 0; | 1181 | rc = 0; |
1182 | tmp = ata_wait_register(port_mmio + PORT_CMD, | 1182 | tmp = ata_wait_register(ap, port_mmio + PORT_CMD, |
1183 | PORT_CMD_CLO, PORT_CMD_CLO, 1, 500); | 1183 | PORT_CMD_CLO, PORT_CMD_CLO, 1, 500); |
1184 | if (tmp & PORT_CMD_CLO) | 1184 | if (tmp & PORT_CMD_CLO) |
1185 | rc = -EIO; | 1185 | rc = -EIO; |
@@ -1209,8 +1209,8 @@ static int ahci_exec_polled_cmd(struct ata_port *ap, int pmp, | |||
1209 | writel(1, port_mmio + PORT_CMD_ISSUE); | 1209 | writel(1, port_mmio + PORT_CMD_ISSUE); |
1210 | 1210 | ||
1211 | if (timeout_msec) { | 1211 | if (timeout_msec) { |
1212 | tmp = ata_wait_register(port_mmio + PORT_CMD_ISSUE, 0x1, 0x1, | 1212 | tmp = ata_wait_register(ap, port_mmio + PORT_CMD_ISSUE, |
1213 | 1, timeout_msec); | 1213 | 0x1, 0x1, 1, timeout_msec); |
1214 | if (tmp & 0x1) { | 1214 | if (tmp & 0x1) { |
1215 | ahci_kick_engine(ap); | 1215 | ahci_kick_engine(ap); |
1216 | return -EBUSY; | 1216 | return -EBUSY; |
@@ -1257,7 +1257,7 @@ int ahci_do_softreset(struct ata_link *link, unsigned int *class, | |||
1257 | } | 1257 | } |
1258 | 1258 | ||
1259 | /* spec says at least 5us, but be generous and sleep for 1ms */ | 1259 | /* spec says at least 5us, but be generous and sleep for 1ms */ |
1260 | msleep(1); | 1260 | ata_msleep(ap, 1); |
1261 | 1261 | ||
1262 | /* issue the second D2H Register FIS */ | 1262 | /* issue the second D2H Register FIS */ |
1263 | tf.ctl &= ~ATA_SRST; | 1263 | tf.ctl &= ~ATA_SRST; |