diff options
Diffstat (limited to 'drivers/ide/ide-io.c')
-rw-r--r-- | drivers/ide/ide-io.c | 43 |
1 files changed, 21 insertions, 22 deletions
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c index 0e406d73b2c8..177db6d5b2f5 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,28 +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 | if (rq) | ||
574 | blk_delay_queue(q, 3); | ||
575 | } | 574 | } |
576 | 575 | ||
577 | static int drive_is_ready(ide_drive_t *drive) | 576 | static int drive_is_ready(ide_drive_t *drive) |