diff options
author | Jens Axboe <jaxboe@fusionio.com> | 2011-03-26 14:49:54 -0400 |
---|---|---|
committer | Jens Axboe <jaxboe@fusionio.com> | 2011-03-26 14:49:54 -0400 |
commit | 9ced0b95b3993660e7990cf6bf68c1a80f31544e (patch) | |
tree | d424345b88c0f2dae88beb6bbb5d153b028f824a /drivers/ide | |
parent | 40471856f2e38e9bfa8d605295e8234421110dd6 (diff) |
ide: ensure that we re-run the queue handler
The conversion to blk_delay_queue() missed parts of IDE.
Add a blk_delay_queue() to ensure that the request handler
gets reinvoked when it needs to.
Note that in all but one place the old plug re-run delay of
3 msecs is used, even though it probably could be shorter
for performance reasons in some of those cases.
Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'drivers/ide')
-rw-r--r-- | drivers/ide/ide-io.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c index f4077840d3ab..0e406d73b2c8 100644 --- a/drivers/ide/ide-io.c +++ b/drivers/ide/ide-io.c | |||
@@ -440,6 +440,7 @@ void do_ide_request(struct request_queue *q) | |||
440 | struct ide_host *host = hwif->host; | 440 | struct ide_host *host = hwif->host; |
441 | struct request *rq = NULL; | 441 | struct request *rq = NULL; |
442 | ide_startstop_t startstop; | 442 | ide_startstop_t startstop; |
443 | unsigned long queue_run_ms = 3; /* old plug delay */ | ||
443 | 444 | ||
444 | spin_unlock_irq(q->queue_lock); | 445 | spin_unlock_irq(q->queue_lock); |
445 | 446 | ||
@@ -459,6 +460,9 @@ repeat: | |||
459 | prev_port = hwif->host->cur_port; | 460 | prev_port = hwif->host->cur_port; |
460 | if (drive->dev_flags & IDE_DFLAG_SLEEPING && | 461 | if (drive->dev_flags & IDE_DFLAG_SLEEPING && |
461 | time_after(drive->sleep, jiffies)) { | 462 | time_after(drive->sleep, jiffies)) { |
463 | unsigned long left = jiffies - drive->sleep; | ||
464 | |||
465 | queue_run_ms = jiffies_to_msecs(left + 1); | ||
462 | ide_unlock_port(hwif); | 466 | ide_unlock_port(hwif); |
463 | goto plug_device; | 467 | goto plug_device; |
464 | } | 468 | } |
@@ -547,8 +551,10 @@ plug_device: | |||
547 | plug_device_2: | 551 | plug_device_2: |
548 | spin_lock_irq(q->queue_lock); | 552 | spin_lock_irq(q->queue_lock); |
549 | 553 | ||
550 | if (rq) | 554 | if (rq) { |
551 | blk_requeue_request(q, rq); | 555 | blk_requeue_request(q, rq); |
556 | blk_delay_queue(q, queue_run_ms); | ||
557 | } | ||
552 | } | 558 | } |
553 | 559 | ||
554 | void ide_requeue_and_plug(ide_drive_t *drive, struct request *rq) | 560 | void ide_requeue_and_plug(ide_drive_t *drive, struct request *rq) |
@@ -562,6 +568,10 @@ void ide_requeue_and_plug(ide_drive_t *drive, struct request *rq) | |||
562 | blk_requeue_request(q, rq); | 568 | blk_requeue_request(q, rq); |
563 | 569 | ||
564 | spin_unlock_irqrestore(q->queue_lock, flags); | 570 | spin_unlock_irqrestore(q->queue_lock, flags); |
571 | |||
572 | /* Use 3ms as that was the old plug delay */ | ||
573 | if (rq) | ||
574 | blk_delay_queue(q, 3); | ||
565 | } | 575 | } |
566 | 576 | ||
567 | static int drive_is_ready(ide_drive_t *drive) | 577 | static int drive_is_ready(ide_drive_t *drive) |