Re: [PATCH 5/5] scsi: enable async shutdown support

From: John Garry

Date: Tue Apr 07 2026 - 12:39:15 EST



}
@@ -1396,6 +1397,7 @@ int scsi_sysfs_add_sdev(struct scsi_device *sdev)
transport_configure_device(&starget->dev);
device_enable_async_suspend(&sdev->sdev_gendev);
+ device_enable_async_shutdown(&sdev->sdev_gendev);

We call device_enable_async_shutdown(&sdev->sdev_gendev) here and scsi_sysfs_device_initialize() - any reason for that?

scsi_autopm_get_target(starget);
pm_runtime_set_active(&sdev->sdev_gendev);
if (!sdev->rpm_autosuspend)
@@ -1415,6 +1417,7 @@ int scsi_sysfs_add_sdev(struct scsi_device *sdev)
}
device_enable_async_suspend(&sdev->sdev_dev);
+ device_enable_async_shutdown(&sdev->sdev_dev);
error = device_add(&sdev->sdev_dev);
if (error) {
sdev_printk(KERN_INFO, sdev,
@@ -1670,6 +1673,7 @@ void scsi_sysfs_device_initialize(struct scsi_device *sdev)
sdev->sdev_gendev.bus = &scsi_bus_type;
sdev->sdev_gendev.type = &scsi_dev_type;
scsi_enable_async_suspend(&sdev->sdev_gendev);
+ device_enable_async_shutdown(&sdev->sdev_gendev);
dev_set_name(&sdev->sdev_gendev, "%d:%d:%d:%llu",
sdev->host->host_no, sdev->channel, sdev->id, sdev->lun);
sdev->sdev_gendev.groups = hostt->sdev_groups;