All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nilesh Javali <njavali@marvell.com>
To: <martin.petersen@oracle.com>
Cc: <linux-scsi@vger.kernel.org>, <GR-QLogic-Storage-Upstream@marvell.com>
Subject: [PATCH 04/12] qla2xxx: Fix hang during NVME session tear down
Date: Mon, 16 Aug 2021 22:13:07 -0700	[thread overview]
Message-ID: <20210817051315.2477-5-njavali@marvell.com> (raw)
In-Reply-To: <20210817051315.2477-1-njavali@marvell.com>

From: Arun Easi <aeasi@marvell.com>

The following hung task call trace was seen:

    [ 1230.183294] INFO: task qla2xxx_wq:523 blocked for more than 120 seconds.
    [ 1230.197749] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
    [ 1230.205585] qla2xxx_wq      D    0   523      2 0x80004000
    [ 1230.205636] Workqueue: qla2xxx_wq qlt_free_session_done [qla2xxx]
    [ 1230.205639] Call Trace:
    [ 1230.208100]  __schedule+0x2c4/0x700
    [ 1230.211607]  schedule+0x38/0xa0
    [ 1230.214769]  schedule_timeout+0x246/0x2f0
    [ 1230.222651]  wait_for_completion+0x97/0x100
    [ 1230.226921]  qlt_free_session_done+0x6a0/0x6f0 [qla2xxx]
    [ 1230.232254]  process_one_work+0x1a7/0x360

..when device side port resets were done.

Abort threads were getting out without processing due to the "deleted"
flag check. The delete thread, meanwhile, could not proceed with a
logout (that would have cleared out pending requests) as the logout iocb
work was not progressing. It appears like the hung qlt_free_session_done()
thread is causing the ha->wq works on hold. The qlt_free_session_done()
was hung waiting for nvme_fc_unregister_remoteport() + localport_delete cb
to be complete, which would only happen when all IOs are released.

Fix this by allowing abort to progress until device delete is completely
done. This should make the qlt_free_session_done proceed without hang
and thus clear up the deadlock.

Signed-off-by: Arun Easi <aeasi@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
---
 drivers/scsi/qla2xxx/qla_nvme.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/qla2xxx/qla_nvme.c b/drivers/scsi/qla2xxx/qla_nvme.c
index 05cad06ff165..d294b590581e 100644
--- a/drivers/scsi/qla2xxx/qla_nvme.c
+++ b/drivers/scsi/qla2xxx/qla_nvme.c
@@ -233,7 +233,7 @@ static void qla_nvme_abort_work(struct work_struct *work)
 	       "%s called for sp=%p, hndl=%x on fcport=%p deleted=%d\n",
 	       __func__, sp, sp->handle, fcport, fcport->deleted);
 
-	if (!ha->flags.fw_started || fcport->deleted)
+	if (!ha->flags.fw_started || fcport->deleted == QLA_SESS_DELETED)
 		goto out;
 
 	if (ha->flags.host_shutting_down) {
-- 
2.23.1


  parent reply	other threads:[~2021-08-17  5:13 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-17  5:13 [PATCH 00/12] qla2xxx driver bug fixes Nilesh Javali
2021-08-17  5:13 ` [PATCH 01/12] qla2xxx: edif: Fix stale session Nilesh Javali
2021-08-17  5:13 ` [PATCH 02/12] qla2xxx: edif: reject AUTH ELS on session down Nilesh Javali
2021-08-17  5:13 ` [PATCH 03/12] qla2xxx: edif: fix edif enable flag Nilesh Javali
2021-08-17  5:13 ` Nilesh Javali [this message]
2021-08-17  5:13 ` [PATCH 05/12] qla2xxx: edif: add N2N support for EDIF Nilesh Javali
2021-08-17  5:13 ` [PATCH 06/12] qla2xxx: edif: do secure plogi when auth app is present Nilesh Javali
2021-08-17  5:13 ` [PATCH 07/12] qla2xxx: fix NVME | FCP personality change Nilesh Javali
2021-08-17  5:13 ` [PATCH 08/12] qla2xxx: Fix hang on NVME command timeouts Nilesh Javali
2021-08-17  5:13 ` [PATCH 09/12] qla2xxx: fix NVME retry Nilesh Javali
2021-08-17  5:13 ` [PATCH 10/12] qla2xxx: fix NVME session down detection Nilesh Javali
2021-08-17  5:13 ` [PATCH 11/12] qla2xxx: edif: fix returnvar.cocci warnings Nilesh Javali
2021-08-17  5:13 ` [PATCH 12/12] qla2xxx: Update version to 10.02.06.200-k Nilesh Javali
2021-08-24  3:05 ` [PATCH 00/12] qla2xxx driver bug fixes Martin K. Petersen
2021-08-28  2:32 ` Martin K. Petersen

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=20210817051315.2477-5-njavali@marvell.com \
    --to=njavali@marvell.com \
    --cc=GR-QLogic-Storage-Upstream@marvell.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.