Re: [PATCH 5/5] scsi: enable async shutdown support
From: David Jeffery
Date: Wed Apr 08 2026 - 21:04:13 EST
On Wed, Apr 8, 2026 at 11:54 AM John Garry <john.g.garry@xxxxxxxxxx> wrote:
>
> On 08/04/2026 15:16, David Jeffery wrote:
> > On Tue, Apr 7, 2026 at 12:35 PM John Garry<john.g.garry@xxxxxxxxxx> wrote:
> >>
> >>> }
> >>> @@ -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?
> >>
> > It was added to match locations where async suspend is set.
>
> Well it is not exactly like that. We have the following:
>
> scsi_sysfs_add_sdev() -> device_enable_async_suspend(&sdev->sdev_gendev)
>
> and
>
> scsi_sysfs_device_initialize() ->
> scsi_enable_async_suspend(&sdev->sdev_gendev) ->
> device_enable_async_suspend(&sdev->sdev_gendev) when not async
>
> Maybe similar needs to be done for this shutdown feature. AFICS, Bart,
> added scsi_enable_async_suspend(), so maybe he can comment.
>
My inclination is to drop adding device_enable_async_shutdown into
scsi_sysfs_device_initialize. The intent is for normal scsi devices,
and I see little value in setting the flag so early to flag partially
initialized or pseudo devices.
David Jeffery