]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: lpfc: Fix deadlock on host_lock during cable pulls
authorJames Smart <jsmart2021@gmail.com>
Wed, 14 Aug 2019 23:56:52 +0000 (16:56 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 20 Aug 2019 02:41:10 +0000 (22:41 -0400)
commit64571d8f7a0b4264671281c9246e1f62f56d168f
tree39829040f70718ecfcff7381691172f6339e186f
parent27e1d771fd0f6e1636dc74a647113727126f29e8
scsi: lpfc: Fix deadlock on host_lock during cable pulls

During cable pull testing a deadlock was seen between lpfc_nlp_counters()
vs lpfc_mbox_process_link_up() vs lpfc_work_list_done(). They are all
waiting on the shost->host_lock.

Issue is all of these cases raise irq when taking out the lock but use
spin_unlock_irq() when unlocking. The unlock path is will unconditionally
re-enable interrupts in cases where irq state should be preserved. The
re-enablement allowed the other paths to execute which then causes the
deadlock.

Fix by converting the lock/unlock to irqsave/irqrestore.

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>
drivers/scsi/lpfc/lpfc_hbadisc.c