From: Yuho Choi <oss.patchbox@gmail.com>
To: Karan Tilak Kumar <kartilak@cisco.com>,
Sesidhar Baddela <sebaddel@cisco.com>,
Narsimhulu Musini <nmusini@cisco.com>
Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>,
"Martin K. Petersen" <mkp@kernel.org>,
linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
Yuho Choi <oss.patchbox@gmail.com>
Subject: [PATCH] scsi: snic: Disable the devcmd2 WQ before freeing its results ring
Date: Tue, 24 Nov 2026 18:02:31 +0000 [thread overview]
Message-ID: <20261124180234.400564-2-oss.patchbox@gmail.com> (raw)
vnic_dev_deinit_devcmd2() frees the devcmd2 results ring before it
disables the devcmd2 WQ. The adapter writes the result of each devcmd2
command into that ring. When a command times out in _svnic_dev_cmd2(),
its descriptor stays posted on the WQ, and snic_remove() ignores the
error from svnic_dev_close(), so the adapter can still complete the
command and write its result after the ring has been freed.
Disable the WQ first, so that the adapter has acknowledged stopping the
queue before the results ring is freed.
Fixes: c8806b6c9e82 ("snic: driver for Cisco SCSI HBA")
Signed-off-by: Yuho Choi <oss.patchbox@gmail.com>
---
Compile-tested only (x86_64, SCSI_SNIC=m, W=1). I have no Cisco VIC
adapter, and the late write would come from the adapter, so I could not
reproduce it.
drivers/scsi/snic/vnic_dev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/scsi/snic/vnic_dev.c b/drivers/scsi/snic/vnic_dev.c
index 22303f827583..44a2cc59821c 100644
--- a/drivers/scsi/snic/vnic_dev.c
+++ b/drivers/scsi/snic/vnic_dev.c
@@ -421,8 +421,8 @@ static void vnic_dev_deinit_devcmd2(struct vnic_dev *vdev)
vdev->devcmd2 = NULL;
vdev->devcmd_rtn = NULL;
- svnic_dev_free_desc_ring(vdev, &dc2c->results_ring);
svnic_wq_disable(&dc2c->wq);
+ svnic_dev_free_desc_ring(vdev, &dc2c->results_ring);
svnic_wq_free(&dc2c->wq);
kfree(dc2c);
}
base-commit: 8dac6df92a2e66e2098bbc69061964cfe7e8375b
--
2.56.1
next reply other threads:[~2026-11-24 18:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-24 18:02 Yuho Choi [this message]
2026-11-24 18:11 ` [PATCH] scsi: snic: Disable the devcmd2 WQ before freeing its results ring sashiko-bot
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=20261124180234.400564-2-oss.patchbox@gmail.com \
--to=oss.patchbox@gmail.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=kartilak@cisco.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=mkp@kernel.org \
--cc=nmusini@cisco.com \
--cc=sebaddel@cisco.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