diff options
Diffstat (limited to 'drivers/scsi/scsi_lib.c')
-rw-r--r-- | drivers/scsi/scsi_lib.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 3ac677c48168..bf7342748f32 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c | |||
@@ -1557,9 +1557,12 @@ static void scsi_request_fn(struct request_queue *q) | |||
1557 | * Dispatch the command to the low-level driver. | 1557 | * Dispatch the command to the low-level driver. |
1558 | */ | 1558 | */ |
1559 | rtn = scsi_dispatch_cmd(cmd); | 1559 | rtn = scsi_dispatch_cmd(cmd); |
1560 | spin_lock_irq(q->queue_lock); | 1560 | if (rtn) { |
1561 | if (rtn) | 1561 | scsi_queue_insert(cmd, rtn); |
1562 | spin_lock_irq(q->queue_lock); | ||
1562 | goto out_delay; | 1563 | goto out_delay; |
1564 | } | ||
1565 | spin_lock_irq(q->queue_lock); | ||
1563 | } | 1566 | } |
1564 | 1567 | ||
1565 | return; | 1568 | return; |
@@ -1579,7 +1582,7 @@ static void scsi_request_fn(struct request_queue *q) | |||
1579 | blk_requeue_request(q, req); | 1582 | blk_requeue_request(q, req); |
1580 | sdev->device_busy--; | 1583 | sdev->device_busy--; |
1581 | out_delay: | 1584 | out_delay: |
1582 | if (sdev->device_busy == 0) | 1585 | if (sdev->device_busy == 0 && !scsi_device_blocked(sdev)) |
1583 | blk_delay_queue(q, SCSI_QUEUE_DELAY); | 1586 | blk_delay_queue(q, SCSI_QUEUE_DELAY); |
1584 | } | 1587 | } |
1585 | 1588 | ||