diff options
| -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 f4077840d3a..0e406d73b2c 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) |
