aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/scsi/qla2xxx/qla_target.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c
index ecf97c5993e8..a463bcc57902 100644
--- a/drivers/scsi/qla2xxx/qla_target.c
+++ b/drivers/scsi/qla2xxx/qla_target.c
@@ -5079,16 +5079,22 @@ qlt_send_busy(struct scsi_qla_host *vha,
5079 5079
5080static int 5080static int
5081qlt_chk_qfull_thresh_hold(struct scsi_qla_host *vha, 5081qlt_chk_qfull_thresh_hold(struct scsi_qla_host *vha,
5082 struct atio_from_isp *atio) 5082 struct atio_from_isp *atio, bool ha_locked)
5083{ 5083{
5084 struct qla_hw_data *ha = vha->hw; 5084 struct qla_hw_data *ha = vha->hw;
5085 uint16_t status; 5085 uint16_t status;
5086 unsigned long flags;
5086 5087
5087 if (ha->tgt.num_pend_cmds < Q_FULL_THRESH_HOLD(ha)) 5088 if (ha->tgt.num_pend_cmds < Q_FULL_THRESH_HOLD(ha))
5088 return 0; 5089 return 0;
5089 5090
5091 if (!ha_locked)
5092 spin_lock_irqsave(&ha->hardware_lock, flags);
5090 status = temp_sam_status; 5093 status = temp_sam_status;
5091 qlt_send_busy(vha, atio, status); 5094 qlt_send_busy(vha, atio, status);
5095 if (!ha_locked)
5096 spin_unlock_irqrestore(&ha->hardware_lock, flags);
5097
5092 return 1; 5098 return 1;
5093} 5099}
5094 5100
@@ -5133,7 +5139,7 @@ static void qlt_24xx_atio_pkt(struct scsi_qla_host *vha,
5133 5139
5134 5140
5135 if (likely(atio->u.isp24.fcp_cmnd.task_mgmt_flags == 0)) { 5141 if (likely(atio->u.isp24.fcp_cmnd.task_mgmt_flags == 0)) {
5136 rc = qlt_chk_qfull_thresh_hold(vha, atio); 5142 rc = qlt_chk_qfull_thresh_hold(vha, atio, ha_locked);
5137 if (rc != 0) { 5143 if (rc != 0) {
5138 tgt->atio_irq_cmd_count--; 5144 tgt->atio_irq_cmd_count--;
5139 return; 5145 return;
@@ -5256,7 +5262,7 @@ static void qlt_response_pkt(struct scsi_qla_host *vha, response_t *pkt)
5256 break; 5262 break;
5257 } 5263 }
5258 5264
5259 rc = qlt_chk_qfull_thresh_hold(vha, atio); 5265 rc = qlt_chk_qfull_thresh_hold(vha, atio, true);
5260 if (rc != 0) { 5266 if (rc != 0) {
5261 tgt->irq_cmd_count--; 5267 tgt->irq_cmd_count--;
5262 return; 5268 return;