From: Jia-Ju Bai <baijiaju1990@gmail.com>
To: james.smart@broadcom.com, dick.kennedy@broadcom.com,
jejb@linux.ibm.com, martin.petersen@oracle.com
Cc: linux-scsi@vger.kernel.org, linux-kernel <linux-kernel@vger.kernel.org>
Subject: [BUG] scsi: lpfc: possible ABBCCA deadlock involving three threads
Date: Mon, 23 Aug 2021 19:31:55 +0800 [thread overview]
Message-ID: <af74e7e6-13dc-0695-e9e2-7dcd758d92f0@gmail.com> (raw)
Hello,
My static analysis tool reports a possible ABBCCA deadlock in the lpfc
driver in Linux 5.10:
lpfc_els_flush_cmd()
spin_lock(&pring->ring_lock); --> line 8124 (Lock A)
lpfc_sli_cancel_iocbs()
lpfc_sli_release_iocbq()
spin_lock_irqsave(&phba->hbalock, iflags); --> line 1384 (Lock B)
lpfc_sli_abort_taskmgmt()
spin_lock_irqsave(&phba->hbalock, iflags); --> line 11812 (Lock B)
spin_lock(&lpfc_cmd->buf_lock); --> line 11830 (Lock C)
lpfc_abort_handler()
spin_lock(&lpfc_cmd->buf_lock); --> line 4760 (Lock C)
spin_lock(&pring_s4->ring_lock); --> line 4777 (Lock A)
When lpfc_els_flush_cmd(), lpfc_sli_abort_taskmgmt() and
lpfc_abort_handler() are concurrently executed, the deadlock can occur.
I am not quite sure whether this possible deadlock is real and how to
fix it if it is real.
Any feedback would be appreciated, thanks :)
Reported-by: TOTE Robot <oslab@tsinghua.edu.cn>
Best wishes,
Jia-Ju Bai
reply other threads:[~2021-08-23 11:32 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=af74e7e6-13dc-0695-e9e2-7dcd758d92f0@gmail.com \
--to=baijiaju1990@gmail.com \
--cc=dick.kennedy@broadcom.com \
--cc=james.smart@broadcom.com \
--cc=jejb@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).