aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/scsi_lib.c')
-rw-r--r--drivers/scsi/scsi_lib.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index 9c44392b748f..aaea4b98af16 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -733,12 +733,13 @@ static bool scsi_end_request(struct request *req, int error,
733 } else { 733 } else {
734 unsigned long flags; 734 unsigned long flags;
735 735
736 if (bidi_bytes)
737 scsi_release_bidi_buffers(cmd);
738
736 spin_lock_irqsave(q->queue_lock, flags); 739 spin_lock_irqsave(q->queue_lock, flags);
737 blk_finish_request(req, error); 740 blk_finish_request(req, error);
738 spin_unlock_irqrestore(q->queue_lock, flags); 741 spin_unlock_irqrestore(q->queue_lock, flags);
739 742
740 if (bidi_bytes)
741 scsi_release_bidi_buffers(cmd);
742 scsi_release_buffers(cmd); 743 scsi_release_buffers(cmd);
743 scsi_next_command(cmd); 744 scsi_next_command(cmd);
744 } 745 }
@@ -1774,7 +1775,7 @@ static void scsi_request_fn(struct request_queue *q)
1774 blk_requeue_request(q, req); 1775 blk_requeue_request(q, req);
1775 atomic_dec(&sdev->device_busy); 1776 atomic_dec(&sdev->device_busy);
1776out_delay: 1777out_delay:
1777 if (atomic_read(&sdev->device_busy) && !scsi_device_blocked(sdev)) 1778 if (!atomic_read(&sdev->device_busy) && !scsi_device_blocked(sdev))
1778 blk_delay_queue(q, SCSI_QUEUE_DELAY); 1779 blk_delay_queue(q, SCSI_QUEUE_DELAY);
1779} 1780}
1780 1781
@@ -1808,7 +1809,6 @@ static int scsi_mq_prep_fn(struct request *req)
1808 1809
1809 cmd->tag = req->tag; 1810 cmd->tag = req->tag;
1810 1811
1811 req->cmd = req->__cmd;
1812 cmd->cmnd = req->cmd; 1812 cmd->cmnd = req->cmd;
1813 cmd->prot_op = SCSI_PROT_NORMAL; 1813 cmd->prot_op = SCSI_PROT_NORMAL;
1814 1814