Commit 8b666809 authored by Quinn Tran's avatar Quinn Tran Committed by Nicholas Bellinger

qla2xxx: Fix request queue corruption.

When FW notify driver or driver detects low FW resource,
driver tries to send out Busy SCSI Status to tell Initiator
side to back off. During the send process, the lock was not held.

Cc: <stable@vger.kernel.org>
Signed-off-by: default avatarQuinn Tran <quinn.tran@qlogic.com>
Signed-off-by: default avatarHimanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
parent ae940f2c
...@@ -5079,16 +5079,22 @@ qlt_send_busy(struct scsi_qla_host *vha, ...@@ -5079,16 +5079,22 @@ qlt_send_busy(struct scsi_qla_host *vha,
static int static int
qlt_chk_qfull_thresh_hold(struct scsi_qla_host *vha, qlt_chk_qfull_thresh_hold(struct scsi_qla_host *vha,
struct atio_from_isp *atio) struct atio_from_isp *atio, bool ha_locked)
{ {
struct qla_hw_data *ha = vha->hw; struct qla_hw_data *ha = vha->hw;
uint16_t status; uint16_t status;
unsigned long flags;
if (ha->tgt.num_pend_cmds < Q_FULL_THRESH_HOLD(ha)) if (ha->tgt.num_pend_cmds < Q_FULL_THRESH_HOLD(ha))
return 0; return 0;
if (!ha_locked)
spin_lock_irqsave(&ha->hardware_lock, flags);
status = temp_sam_status; status = temp_sam_status;
qlt_send_busy(vha, atio, status); qlt_send_busy(vha, atio, status);
if (!ha_locked)
spin_unlock_irqrestore(&ha->hardware_lock, flags);
return 1; return 1;
} }
...@@ -5133,7 +5139,7 @@ static void qlt_24xx_atio_pkt(struct scsi_qla_host *vha, ...@@ -5133,7 +5139,7 @@ static void qlt_24xx_atio_pkt(struct scsi_qla_host *vha,
if (likely(atio->u.isp24.fcp_cmnd.task_mgmt_flags == 0)) { if (likely(atio->u.isp24.fcp_cmnd.task_mgmt_flags == 0)) {
rc = qlt_chk_qfull_thresh_hold(vha, atio); rc = qlt_chk_qfull_thresh_hold(vha, atio, ha_locked);
if (rc != 0) { if (rc != 0) {
tgt->atio_irq_cmd_count--; tgt->atio_irq_cmd_count--;
return; return;
...@@ -5256,7 +5262,7 @@ static void qlt_response_pkt(struct scsi_qla_host *vha, response_t *pkt) ...@@ -5256,7 +5262,7 @@ static void qlt_response_pkt(struct scsi_qla_host *vha, response_t *pkt)
break; break;
} }
rc = qlt_chk_qfull_thresh_hold(vha, atio); rc = qlt_chk_qfull_thresh_hold(vha, atio, true);
if (rc != 0) { if (rc != 0) {
tgt->irq_cmd_count--; tgt->irq_cmd_count--;
return; return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment