summaryrefslogtreecommitdiff
path: root/drivers/scsi/scsi_debug.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2023-05-06 18:37:28 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2023-05-06 18:37:28 +0300
commitdd9e11d6477a52ede9ebe575c83285e79e823889 (patch)
treecd865e677ff2be4c7a0b5baf4e38411e63a97148 /drivers/scsi/scsi_debug.c
parenta3b111b046f6ce5dff168af203daf2f46f3afb29 (diff)
parentc5749639f2d0a1f6cbe187d05f70c2e7c544d748 (diff)
downloadlinux-dd9e11d6477a52ede9ebe575c83285e79e823889.tar.xz
Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Pull more SCSI updates from James Bottomley: "Six late arriving patches for the merge window. Five are minor assorted fixes and updates. The IPR driver change removes SATA support, which will now allow a major cleanup in the ATA subsystem because it was the only driver still using the old attachment mechanism. The driver is only used on power systems and SATA was used to support a DVD device, which has long been moved to a different hba. IBM chose this route instead of porting ipr to the newer SATA interfaces" * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: qedi: Fix use after free bug in qedi_remove() scsi: ufs: core: mcq: Fix &hwq->cq_lock deadlock issue scsi: ipr: Remove several unused variables scsi: pm80xx: Log device registration scsi: ipr: Remove SATA support scsi: scsi_debug: Abort commands from scsi_debug_device_reset()
Diffstat (limited to 'drivers/scsi/scsi_debug.c')
-rw-r--r--drivers/scsi/scsi_debug.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
index f4fa1035a191..8c58128ad32a 100644
--- a/drivers/scsi/scsi_debug.c
+++ b/drivers/scsi/scsi_debug.c
@@ -5291,6 +5291,26 @@ static int scsi_debug_abort(struct scsi_cmnd *SCpnt)
return SUCCESS;
}
+static bool scsi_debug_stop_all_queued_iter(struct request *rq, void *data)
+{
+ struct scsi_device *sdp = data;
+ struct scsi_cmnd *scmd = blk_mq_rq_to_pdu(rq);
+
+ if (scmd->device == sdp)
+ scsi_debug_abort_cmnd(scmd);
+
+ return true;
+}
+
+/* Deletes (stops) timers or work queues of all queued commands per sdev */
+static void scsi_debug_stop_all_queued(struct scsi_device *sdp)
+{
+ struct Scsi_Host *shost = sdp->host;
+
+ blk_mq_tagset_busy_iter(&shost->tag_set,
+ scsi_debug_stop_all_queued_iter, sdp);
+}
+
static int scsi_debug_device_reset(struct scsi_cmnd *SCpnt)
{
struct scsi_device *sdp = SCpnt->device;
@@ -5300,6 +5320,8 @@ static int scsi_debug_device_reset(struct scsi_cmnd *SCpnt)
if (SDEBUG_OPT_ALL_NOISE & sdebug_opts)
sdev_printk(KERN_INFO, sdp, "%s\n", __func__);
+
+ scsi_debug_stop_all_queued(sdp);
if (devip)
set_bit(SDEBUG_UA_POR, devip->uas_bm);