The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] scsi: snic: Disable the devcmd2 WQ before freeing its results ring
@ 2026-11-24 18:02 Yuho Choi
  0 siblings, 0 replies; only message in thread
From: Yuho Choi @ 2026-11-24 18:02 UTC (permalink / raw)
  To: Karan Tilak Kumar, Sesidhar Baddela, Narsimhulu Musini
  Cc: James E.J. Bottomley, Martin K. Petersen, linux-scsi,
	linux-kernel, Yuho Choi

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


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-24 18:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-24 18:02 [PATCH] scsi: snic: Disable the devcmd2 WQ before freeing its results ring Yuho Choi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox