diff options
-rw-r--r-- | drivers/ide/ide-io.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c index 23754bc5e595..40327d1e6a9f 100644 --- a/drivers/ide/ide-io.c +++ b/drivers/ide/ide-io.c | |||
@@ -786,7 +786,6 @@ void do_ide_request(struct request_queue *q) | |||
786 | ide_hwif_t *hwif; | 786 | ide_hwif_t *hwif; |
787 | struct request *rq; | 787 | struct request *rq; |
788 | ide_startstop_t startstop; | 788 | ide_startstop_t startstop; |
789 | int loops = 0; | ||
790 | 789 | ||
791 | /* caller must own hwgroup->lock */ | 790 | /* caller must own hwgroup->lock */ |
792 | BUG_ON(!irqs_disabled()); | 791 | BUG_ON(!irqs_disabled()); |
@@ -844,7 +843,7 @@ void do_ide_request(struct request_queue *q) | |||
844 | 843 | ||
845 | if (drive != orig_drive) | 844 | if (drive != orig_drive) |
846 | goto plug_device; | 845 | goto plug_device; |
847 | again: | 846 | |
848 | hwif = drive->hwif; | 847 | hwif = drive->hwif; |
849 | 848 | ||
850 | if (hwif != hwgroup->hwif) { | 849 | if (hwif != hwgroup->hwif) { |
@@ -882,16 +881,10 @@ again: | |||
882 | * though. I hope that doesn't happen too much, hopefully not | 881 | * though. I hope that doesn't happen too much, hopefully not |
883 | * unless the subdriver triggers such a thing in its own PM | 882 | * unless the subdriver triggers such a thing in its own PM |
884 | * state machine. | 883 | * state machine. |
885 | * | ||
886 | * We count how many times we loop here to make sure we service | ||
887 | * all drives in the hwgroup without looping for ever | ||
888 | */ | 884 | */ |
889 | if ((drive->dev_flags & IDE_DFLAG_BLOCKED) && | 885 | if ((drive->dev_flags & IDE_DFLAG_BLOCKED) && |
890 | blk_pm_request(rq) == 0 && | 886 | blk_pm_request(rq) == 0 && |
891 | (rq->cmd_flags & REQ_PREEMPT) == 0) { | 887 | (rq->cmd_flags & REQ_PREEMPT) == 0) { |
892 | drive = drive->next ? drive->next : hwgroup->drive; | ||
893 | if (loops++ < 4 && !blk_queue_plugged(drive->queue)) | ||
894 | goto again; | ||
895 | /* We clear busy, there should be no pending ATA command at this point. */ | 888 | /* We clear busy, there should be no pending ATA command at this point. */ |
896 | hwgroup->busy = 0; | 889 | hwgroup->busy = 0; |
897 | goto plug_device; | 890 | goto plug_device; |