diff options
Diffstat (limited to 'drivers/ide/ide-probe.c')
| -rw-r--r-- | drivers/ide/ide-probe.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c index 63627be0811a..5aeaca24a28f 100644 --- a/drivers/ide/ide-probe.c +++ b/drivers/ide/ide-probe.c | |||
| @@ -1159,18 +1159,27 @@ static void drive_rq_insert_work(struct work_struct *work) | |||
| 1159 | ide_drive_t *drive = container_of(work, ide_drive_t, rq_work); | 1159 | ide_drive_t *drive = container_of(work, ide_drive_t, rq_work); |
| 1160 | ide_hwif_t *hwif = drive->hwif; | 1160 | ide_hwif_t *hwif = drive->hwif; |
| 1161 | struct request *rq; | 1161 | struct request *rq; |
| 1162 | blk_status_t ret; | ||
| 1162 | LIST_HEAD(list); | 1163 | LIST_HEAD(list); |
| 1163 | 1164 | ||
| 1164 | spin_lock_irq(&hwif->lock); | 1165 | blk_mq_quiesce_queue(drive->queue); |
| 1165 | if (!list_empty(&drive->rq_list)) | ||
| 1166 | list_splice_init(&drive->rq_list, &list); | ||
| 1167 | spin_unlock_irq(&hwif->lock); | ||
| 1168 | 1166 | ||
| 1169 | while (!list_empty(&list)) { | 1167 | ret = BLK_STS_OK; |
| 1170 | rq = list_first_entry(&list, struct request, queuelist); | 1168 | spin_lock_irq(&hwif->lock); |
| 1169 | while (!list_empty(&drive->rq_list)) { | ||
| 1170 | rq = list_first_entry(&drive->rq_list, struct request, queuelist); | ||
| 1171 | list_del_init(&rq->queuelist); | 1171 | list_del_init(&rq->queuelist); |
| 1172 | blk_execute_rq_nowait(drive->queue, rq->rq_disk, rq, true, NULL); | 1172 | |
| 1173 | spin_unlock_irq(&hwif->lock); | ||
| 1174 | ret = ide_issue_rq(drive, rq, true); | ||
| 1175 | spin_lock_irq(&hwif->lock); | ||
| 1173 | } | 1176 | } |
| 1177 | spin_unlock_irq(&hwif->lock); | ||
| 1178 | |||
| 1179 | blk_mq_unquiesce_queue(drive->queue); | ||
| 1180 | |||
| 1181 | if (ret != BLK_STS_OK) | ||
| 1182 | kblockd_schedule_work(&drive->rq_work); | ||
| 1174 | } | 1183 | } |
| 1175 | 1184 | ||
| 1176 | static const u8 ide_hwif_to_major[] = | 1185 | static const u8 ide_hwif_to_major[] = |
