aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc/lpfc_init.c
diff options
context:
space:
mode:
authorJames Smart <jsmart2021@gmail.com>2019-03-12 16:30:12 -0700
committerMartin K. Petersen <martin.petersen@oracle.com>2019-03-19 12:57:02 -0400
commit731eedcb317a5a4b5776d3c78ffe5e79c596fa16 (patch)
tree449a2b9414aea3df77bdc868b948d3be82ee57cb /drivers/scsi/lpfc/lpfc_init.c
parentscsi: lpfc: Fix nvmet handling of first burst cmd (diff)
downloadlinux-dev-731eedcb317a5a4b5776d3c78ffe5e79c596fa16.tar.xz
linux-dev-731eedcb317a5a4b5776d3c78ffe5e79c596fa16.zip
scsi: lpfc: Fix deadlock due to nested hbalock call
If an adapter fails, causing a board reset, the board reset routine lpfc_hba_down_s4() takes the hbalock out then calls lpfc_nvmet_ctxbuf_post() who then tries to take out the same lock. As the context lists are now protected under the buf_list_locks, there is no need for the hbalock to be held by the board reset routine. Fix by no longer taking the hbalock in the board reset routine. Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com> Signed-off-by: James Smart <jsmart2021@gmail.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to '')
-rw-r--r--drivers/scsi/lpfc/lpfc_init.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index 6deb4d29c0cb..291ad3b10d56 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -1117,19 +1117,19 @@ lpfc_hba_down_post_s4(struct lpfc_hba *phba)
}
}
+ spin_unlock_irq(&phba->hbalock);
if (phba->cfg_enable_fc4_type & LPFC_ENABLE_NVME) {
- spin_lock(&phba->sli4_hba.abts_nvmet_buf_list_lock);
+ spin_lock_irq(&phba->sli4_hba.abts_nvmet_buf_list_lock);
list_splice_init(&phba->sli4_hba.lpfc_abts_nvmet_ctx_list,
&nvmet_aborts);
- spin_unlock(&phba->sli4_hba.abts_nvmet_buf_list_lock);
+ spin_unlock_irq(&phba->sli4_hba.abts_nvmet_buf_list_lock);
list_for_each_entry_safe(ctxp, ctxp_next, &nvmet_aborts, list) {
ctxp->flag &= ~(LPFC_NVMET_XBUSY | LPFC_NVMET_ABORT_OP);
lpfc_nvmet_ctxbuf_post(phba, ctxp->ctxbuf);
}
}
- spin_unlock_irq(&phba->hbalock);
lpfc_sli4_free_sp_events(phba);
return cnt;
}