Skip to content

Commit 782b86e

Browse files
author
Jens Axboe
committed
ide: always ensure that blk_delay_queue() is called if we have pending IO
Just because we are not requeuing a request does not mean that some aren't pending. So always issue a blk_delay_queue() if either we are requeueing OR there's pending IO. This fixes a boot problem for some IDE boxes. Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
1 parent f83e826 commit 782b86e

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

drivers/ide/ide-io.c

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,26 @@ static inline void ide_unlock_host(struct ide_host *host)
430430
}
431431
}
432432

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+
433453
/*
434454
* Issue a new request to a device.
435455
*/
@@ -550,27 +570,7 @@ void do_ide_request(struct request_queue *q)
550570
ide_unlock_host(host);
551571
plug_device_2:
552572
spin_lock_irq(q->queue_lock);
553-
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);
573+
__ide_requeue_and_plug(q, rq);
574574
}
575575

576576
static int drive_is_ready(ide_drive_t *drive)

0 commit comments

Comments
 (0)