aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/scsi/scsi_sysfs.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
index 6a9040faed00..3b119ca0cc0c 100644
--- a/drivers/scsi/scsi_sysfs.c
+++ b/drivers/scsi/scsi_sysfs.c
@@ -771,6 +771,12 @@ store_state_field(struct device *dev, struct device_attribute *attr,
771 771
772 mutex_lock(&sdev->state_mutex); 772 mutex_lock(&sdev->state_mutex);
773 ret = scsi_device_set_state(sdev, state); 773 ret = scsi_device_set_state(sdev, state);
774 /*
775 * If the device state changes to SDEV_RUNNING, we need to run
776 * the queue to avoid I/O hang.
777 */
778 if (ret == 0 && state == SDEV_RUNNING)
779 blk_mq_run_hw_queues(sdev->request_queue, true);
774 mutex_unlock(&sdev->state_mutex); 780 mutex_unlock(&sdev->state_mutex);
775 781
776 return ret == 0 ? count : -EINVAL; 782 return ret == 0 ? count : -EINVAL;