Commit 398d81c9 authored by James Smart's avatar James Smart Committed by James Bottomley

[SCSI] lpfc 8.3.40: Fixed list corruption when lpfc_drain_tx runs.

Signed-off-by: default avatarJames Smart <james.smart@emulex.com>
Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
parent e85d8f9f
...@@ -16286,7 +16286,7 @@ lpfc_drain_txq(struct lpfc_hba *phba) ...@@ -16286,7 +16286,7 @@ lpfc_drain_txq(struct lpfc_hba *phba)
union lpfc_wqe wqe; union lpfc_wqe wqe;
int txq_cnt = 0; int txq_cnt = 0;
spin_lock_irqsave(&phba->hbalock, iflags); spin_lock_irqsave(&pring->ring_lock, iflags);
list_for_each_entry(piocbq, &pring->txq, list) { list_for_each_entry(piocbq, &pring->txq, list) {
txq_cnt++; txq_cnt++;
} }
...@@ -16294,14 +16294,14 @@ lpfc_drain_txq(struct lpfc_hba *phba) ...@@ -16294,14 +16294,14 @@ lpfc_drain_txq(struct lpfc_hba *phba)
if (txq_cnt > pring->txq_max) if (txq_cnt > pring->txq_max)
pring->txq_max = txq_cnt; pring->txq_max = txq_cnt;
spin_unlock_irqrestore(&phba->hbalock, iflags); spin_unlock_irqrestore(&pring->ring_lock, iflags);
while (!list_empty(&pring->txq)) { while (!list_empty(&pring->txq)) {
spin_lock_irqsave(&phba->hbalock, iflags); spin_lock_irqsave(&pring->ring_lock, iflags);
piocbq = lpfc_sli_ringtx_get(phba, pring); piocbq = lpfc_sli_ringtx_get(phba, pring);
if (!piocbq) { if (!piocbq) {
spin_unlock_irqrestore(&phba->hbalock, iflags); spin_unlock_irqrestore(&pring->ring_lock, iflags);
lpfc_printf_log(phba, KERN_ERR, LOG_SLI, lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
"2823 txq empty and txq_cnt is %d\n ", "2823 txq empty and txq_cnt is %d\n ",
txq_cnt); txq_cnt);
...@@ -16310,7 +16310,7 @@ lpfc_drain_txq(struct lpfc_hba *phba) ...@@ -16310,7 +16310,7 @@ lpfc_drain_txq(struct lpfc_hba *phba)
sglq = __lpfc_sli_get_sglq(phba, piocbq); sglq = __lpfc_sli_get_sglq(phba, piocbq);
if (!sglq) { if (!sglq) {
__lpfc_sli_ringtx_put(phba, pring, piocbq); __lpfc_sli_ringtx_put(phba, pring, piocbq);
spin_unlock_irqrestore(&phba->hbalock, iflags); spin_unlock_irqrestore(&pring->ring_lock, iflags);
break; break;
} }
txq_cnt--; txq_cnt--;
...@@ -16338,7 +16338,7 @@ lpfc_drain_txq(struct lpfc_hba *phba) ...@@ -16338,7 +16338,7 @@ lpfc_drain_txq(struct lpfc_hba *phba)
piocbq->iotag, piocbq->sli4_xritag); piocbq->iotag, piocbq->sli4_xritag);
list_add_tail(&piocbq->list, &completions); list_add_tail(&piocbq->list, &completions);
} }
spin_unlock_irqrestore(&phba->hbalock, iflags); spin_unlock_irqrestore(&pring->ring_lock, iflags);
} }
/* Cancel all the IOCBs that cannot be issued */ /* Cancel all the IOCBs that cannot be issued */
......
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