diff options
| -rw-r--r-- | drivers/ide/ide-io.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c index ca27d3090ae..177db6d5b2f 100644 --- a/drivers/ide/ide-io.c +++ b/drivers/ide/ide-io.c | |||
| @@ -430,6 +430,26 @@ static inline void ide_unlock_host(struct ide_host *host) | |||
| 430 | } | 430 | } |
| 431 | } | 431 | } |
| 432 | 432 | ||
| 433 | static void __ide_requeue_and_plug(struct request_queue *q, struct request *rq) | ||
| 434 | { | ||
| 435 | if (rq) | ||
| 436 | blk_requeue_request(q, rq); | ||
| 437 | if (rq || blk_peek_request(q)) { | ||
| 438 | /* Use 3ms as that was the old plug delay */ | ||
| 439 | blk_delay_queue(q, 3); | ||
| 440 | } | ||
| 441 | } | ||
| 442 | |||
| 443 | void ide_requeue_and_plug(ide_drive_t *drive, struct request *rq) | ||
| 444 | { | ||
| 445 | struct request_queue *q = drive->queue; | ||
| 446 | unsigned long flags; | ||
| 447 | |||
| 448 | spin_lock_irqsave(q->queue_lock, flags); | ||
| 449 | __ide_requeue_and_plug(q, rq); | ||
| 450 | spin_unlock_irqrestore(q->queue_lock, flags); | ||
| 451 | } | ||
| 452 | |||
| 433 | /* | 453 | /* |
| 434 | * Issue a new request to a device. | 454 | * Issue a new request to a device. |
| 435 | */ | 455 | */ |
| @@ -550,27 +570,7 @@ plug_device: | |||
| 550 | ide_unlock_host(host); | 570 | ide_unlock_host(host); |
| 551 | plug_device_2: | 571 | plug_device_2: |
| 552 | spin_lock_irq(q->queue_lock); | 572 | spin_lock_irq(q->queue_lock); |
| 553 | 573 | __ide_requeue_and_plug(q, rq); | |
| 554 | if (rq) { | ||
| 555 | blk_requeue_request(q, rq); | ||
| 556 | blk_delay_queue(q, queue_run_ms); | ||
| 557 | } | ||
| 558 | } | ||
| 559 | |||
| 560 | void ide_requeue_and_plug(ide_drive_t *drive, struct request *rq) | ||
| 561 | { | ||
| 562 | struct request_queue *q = drive->queue; | ||
| 563 | unsigned long flags; | ||
| 564 | |||
| 565 | spin_lock_irqsave(q->queue_lock, flags); | ||
| 566 | |||
| 567 | if (rq) | ||
| 568 | blk_requeue_request(q, rq); | ||
| 569 | |||
| 570 | spin_unlock_irqrestore(q->queue_lock, flags); | ||
| 571 | |||
| 572 | /* Use 3ms as that was the old plug delay */ | ||
| 573 | blk_delay_queue(q, 3); | ||
| 574 | } | 574 | } |
| 575 | 575 | ||
| 576 | static int drive_is_ready(ide_drive_t *drive) | 576 | static int drive_is_ready(ide_drive_t *drive) |
