From 3f2d50b5894b9c213a4986dcea6929d585ce6c72 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Fri, 22 Mar 2019 02:26:44 +0000 Subject: [PATCH] scst: Do not suspend command processing when deleting a device Now that freeing a device only happens after all commands associated with the device have finished it is safe to not suspend command processing when deleting a device. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8067 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/scst_main.c | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/scst/src/scst_main.c b/scst/src/scst_main.c index 7851ae9c4..0246dc3f6 100644 --- a/scst/src/scst_main.c +++ b/scst/src/scst_main.c @@ -1182,25 +1182,12 @@ static void scst_unregister_device(struct scsi_device *scsidp) { struct scst_device *dev; struct scst_acg_dev *acg_dev, *aa; - bool activity_suspended = false; TRACE_ENTRY(); mutex_lock(&scst_mutex); dev = __scst_lookup_device(scsidp); - - if (dev && - (!list_empty(&dev->dev_tgt_dev_list) || - !list_empty(&dev->dev_acg_dev_list))) { - mutex_unlock(&scst_mutex); - - scst_suspend_activity(SCST_SUSPEND_TIMEOUT_UNLIMITED); - activity_suspended = true; - mutex_lock(&scst_mutex); - dev = __scst_lookup_device(scsidp); - } - if (dev == NULL) { PRINT_ERROR("SCST device for SCSI device %d:%d:%d:%lld not found", scsidp->host->host_no, scsidp->channel, scsidp->id, @@ -1225,9 +1212,6 @@ static void scst_unregister_device(struct scsi_device *scsidp) mutex_unlock(&scst_mutex); - if (activity_suspended) - scst_resume_activity(); - scst_dev_sysfs_del(dev); PRINT_INFO("Detached from scsi%d, channel %d, id %d, lun %lld, type %d", @@ -1242,8 +1226,6 @@ out: out_unlock: mutex_unlock(&scst_mutex); - if (activity_suspended) - scst_resume_activity(); goto out; }