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/libata-sff.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/libata-sff.c')
-rw-r--r-- | drivers/ata/libata-sff.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c index 193f242eec05..14d18bf81255 100644 --- a/drivers/ata/libata-sff.c +++ b/drivers/ata/libata-sff.c | |||
@@ -222,7 +222,7 @@ int ata_sff_busy_sleep(struct ata_port *ap, | |||
222 | timeout = ata_deadline(timer_start, tmout_pat); | 222 | timeout = ata_deadline(timer_start, tmout_pat); |
223 | while (status != 0xff && (status & ATA_BUSY) && | 223 | while (status != 0xff && (status & ATA_BUSY) && |
224 | time_before(jiffies, timeout)) { | 224 | time_before(jiffies, timeout)) { |
225 | msleep(50); | 225 | ata_msleep(ap, 50); |
226 | status = ata_sff_busy_wait(ap, ATA_BUSY, 3); | 226 | status = ata_sff_busy_wait(ap, ATA_BUSY, 3); |
227 | } | 227 | } |
228 | 228 | ||
@@ -234,7 +234,7 @@ int ata_sff_busy_sleep(struct ata_port *ap, | |||
234 | timeout = ata_deadline(timer_start, tmout); | 234 | timeout = ata_deadline(timer_start, tmout); |
235 | while (status != 0xff && (status & ATA_BUSY) && | 235 | while (status != 0xff && (status & ATA_BUSY) && |
236 | time_before(jiffies, timeout)) { | 236 | time_before(jiffies, timeout)) { |
237 | msleep(50); | 237 | ata_msleep(ap, 50); |
238 | status = ap->ops->sff_check_status(ap); | 238 | status = ap->ops->sff_check_status(ap); |
239 | } | 239 | } |
240 | 240 | ||
@@ -360,7 +360,7 @@ static void ata_dev_select(struct ata_port *ap, unsigned int device, | |||
360 | 360 | ||
361 | if (wait) { | 361 | if (wait) { |
362 | if (can_sleep && ap->link.device[device].class == ATA_DEV_ATAPI) | 362 | if (can_sleep && ap->link.device[device].class == ATA_DEV_ATAPI) |
363 | msleep(150); | 363 | ata_msleep(ap, 150); |
364 | ata_wait_idle(ap); | 364 | ata_wait_idle(ap); |
365 | } | 365 | } |
366 | } | 366 | } |
@@ -1356,7 +1356,7 @@ fsm_start: | |||
1356 | */ | 1356 | */ |
1357 | status = ata_sff_busy_wait(ap, ATA_BUSY, 5); | 1357 | status = ata_sff_busy_wait(ap, ATA_BUSY, 5); |
1358 | if (status & ATA_BUSY) { | 1358 | if (status & ATA_BUSY) { |
1359 | msleep(2); | 1359 | ata_msleep(ap, 2); |
1360 | status = ata_sff_busy_wait(ap, ATA_BUSY, 10); | 1360 | status = ata_sff_busy_wait(ap, ATA_BUSY, 10); |
1361 | if (status & ATA_BUSY) { | 1361 | if (status & ATA_BUSY) { |
1362 | ata_sff_queue_pio_task(link, ATA_SHORT_PAUSE); | 1362 | ata_sff_queue_pio_task(link, ATA_SHORT_PAUSE); |
@@ -1937,7 +1937,7 @@ int ata_sff_wait_after_reset(struct ata_link *link, unsigned int devmask, | |||
1937 | unsigned int dev1 = devmask & (1 << 1); | 1937 | unsigned int dev1 = devmask & (1 << 1); |
1938 | int rc, ret = 0; | 1938 | int rc, ret = 0; |
1939 | 1939 | ||
1940 | msleep(ATA_WAIT_AFTER_RESET); | 1940 | ata_msleep(ap, ATA_WAIT_AFTER_RESET); |
1941 | 1941 | ||
1942 | /* always check readiness of the master device */ | 1942 | /* always check readiness of the master device */ |
1943 | rc = ata_sff_wait_ready(link, deadline); | 1943 | rc = ata_sff_wait_ready(link, deadline); |
@@ -1966,7 +1966,7 @@ int ata_sff_wait_after_reset(struct ata_link *link, unsigned int devmask, | |||
1966 | lbal = ioread8(ioaddr->lbal_addr); | 1966 | lbal = ioread8(ioaddr->lbal_addr); |
1967 | if ((nsect == 1) && (lbal == 1)) | 1967 | if ((nsect == 1) && (lbal == 1)) |
1968 | break; | 1968 | break; |
1969 | msleep(50); /* give drive a breather */ | 1969 | ata_msleep(ap, 50); /* give drive a breather */ |
1970 | } | 1970 | } |
1971 | 1971 | ||
1972 | rc = ata_sff_wait_ready(link, deadline); | 1972 | rc = ata_sff_wait_ready(link, deadline); |