* [PATCH 1/5] driver core: separate function to shutdown one device
2026-05-18 19:31 [PATCH v16 0/5] shut down devices asynchronously David Jeffery
@ 2026-05-18 19:32 ` David Jeffery
2026-05-18 19:32 ` [PATCH 2/5] driver core: do not always lock parent in shutdown David Jeffery
` (4 subsequent siblings)
5 siblings, 0 replies; 8+ messages in thread
From: David Jeffery @ 2026-05-18 19:32 UTC (permalink / raw)
To: linux-kernel, driver-core, linux-pci, linux-scsi,
Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich
Cc: Tarun Sahu, Pasha Tatashin, Michał Cłapiński,
Jordan Richards, Ewan Milne, John Meneghini, Lombardi, Maurizio,
Stuart Hayes, Laurence Oberman, Bart Van Assche, Bjorn Helgaas,
Martin K . Petersen, John Garry, kexec, David Jeffery,
Pasha Tatashin
Make a separate function for the part of device_shutdown() that does the
shutown for a single device. This is in preparation for making device
shutdown asynchronous.
Signed-off-by: Stuart Hayes <stuart.w.hayes@gmail.com>
Signed-off-by: David Jeffery <djeffery@redhat.com>
Tested-by: Laurence Oberman <loberman@redhat.com>
Tested-by: Tarun Sahu <tarunsahu@google.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Pasha Tatashin <pasha.tatashin@soleen.com>
---
drivers/base/core.c | 71 +++++++++++++++++++++++++--------------------
1 file changed, 39 insertions(+), 32 deletions(-)
diff --git a/drivers/base/core.c b/drivers/base/core.c
index d49420e066de..127432248165 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -4795,12 +4795,48 @@ int device_change_owner(struct device *dev, kuid_t kuid, kgid_t kgid)
return error;
}
+static void shutdown_one_device(struct device *dev)
+{
+ struct device *parent = dev->parent;
+
+ /* hold lock to avoid race with probe/release */
+ if (parent)
+ device_lock(parent);
+ device_lock(dev);
+
+ /* Don't allow any more runtime suspends */
+ pm_runtime_get_noresume(dev);
+ pm_runtime_barrier(dev);
+
+ if (dev->class && dev->class->shutdown_pre) {
+ if (initcall_debug)
+ dev_info(dev, "shutdown_pre\n");
+ dev->class->shutdown_pre(dev);
+ }
+ if (dev->bus && dev->bus->shutdown) {
+ if (initcall_debug)
+ dev_info(dev, "shutdown\n");
+ dev->bus->shutdown(dev);
+ } else if (dev->driver && dev->driver->shutdown) {
+ if (initcall_debug)
+ dev_info(dev, "shutdown\n");
+ dev->driver->shutdown(dev);
+ }
+
+ device_unlock(dev);
+ if (parent)
+ device_unlock(parent);
+
+ put_device(parent);
+ put_device(dev);
+}
+
/**
* device_shutdown - call ->shutdown() on each device to shutdown.
*/
void device_shutdown(void)
{
- struct device *dev, *parent;
+ struct device *dev;
wait_for_device_probe();
device_block_probing();
@@ -4822,7 +4858,7 @@ void device_shutdown(void)
* prevent it from being freed because parent's
* lock is to be held
*/
- parent = get_device(dev->parent);
+ get_device(dev->parent);
get_device(dev);
/*
* Make sure the device is off the kset list, in the
@@ -4831,36 +4867,7 @@ void device_shutdown(void)
list_del_init(&dev->kobj.entry);
spin_unlock(&devices_kset->list_lock);
- /* hold lock to avoid race with probe/release */
- if (parent)
- device_lock(parent);
- device_lock(dev);
-
- /* Don't allow any more runtime suspends */
- pm_runtime_get_noresume(dev);
- pm_runtime_barrier(dev);
-
- if (dev->class && dev->class->shutdown_pre) {
- if (initcall_debug)
- dev_info(dev, "shutdown_pre\n");
- dev->class->shutdown_pre(dev);
- }
- if (dev->bus && dev->bus->shutdown) {
- if (initcall_debug)
- dev_info(dev, "shutdown\n");
- dev->bus->shutdown(dev);
- } else if (dev->driver && dev->driver->shutdown) {
- if (initcall_debug)
- dev_info(dev, "shutdown\n");
- dev->driver->shutdown(dev);
- }
-
- device_unlock(dev);
- if (parent)
- device_unlock(parent);
-
- put_device(dev);
- put_device(parent);
+ shutdown_one_device(dev);
spin_lock(&devices_kset->list_lock);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH 2/5] driver core: do not always lock parent in shutdown
2026-05-18 19:31 [PATCH v16 0/5] shut down devices asynchronously David Jeffery
2026-05-18 19:32 ` [PATCH 1/5] driver core: separate function to shutdown one device David Jeffery
@ 2026-05-18 19:32 ` David Jeffery
2026-05-18 19:32 ` [PATCH 3/5] driver core: async device shutdown infrastructure David Jeffery
` (3 subsequent siblings)
5 siblings, 0 replies; 8+ messages in thread
From: David Jeffery @ 2026-05-18 19:32 UTC (permalink / raw)
To: linux-kernel, driver-core, linux-pci, linux-scsi,
Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich
Cc: Tarun Sahu, Pasha Tatashin, Michał Cłapiński,
Jordan Richards, Ewan Milne, John Meneghini, Lombardi, Maurizio,
Stuart Hayes, Laurence Oberman, Bart Van Assche, Bjorn Helgaas,
Martin K . Petersen, John Garry, kexec, David Jeffery,
Pasha Tatashin
Don't lock a parent device unless it is needed in device_shutdown. This
is in preparation for making device shutdown asynchronous, when it will
be needed to allow children of a common parent to shut down
simultaneously.
And only acquire a reference to the parent device if the parent is to be
locked.
Signed-off-by: Stuart Hayes <stuart.w.hayes@gmail.com>
Signed-off-by: David Jeffery <djeffery@redhat.com>
Tested-by: Laurence Oberman <loberman@redhat.com>
Tested-by: Tarun Sahu <tarunsahu@google.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Pasha Tatashin <pasha.tatashin@soleen.com>
---
drivers/base/core.c | 30 ++++++++++++++++--------------
1 file changed, 16 insertions(+), 14 deletions(-)
diff --git a/drivers/base/core.c b/drivers/base/core.c
index 127432248165..6e2c37115bc1 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -4795,13 +4795,8 @@ int device_change_owner(struct device *dev, kuid_t kuid, kgid_t kgid)
return error;
}
-static void shutdown_one_device(struct device *dev)
+static void __shutdown_one_device(struct device *dev)
{
- struct device *parent = dev->parent;
-
- /* hold lock to avoid race with probe/release */
- if (parent)
- device_lock(parent);
device_lock(dev);
/* Don't allow any more runtime suspends */
@@ -4824,10 +4819,23 @@ static void shutdown_one_device(struct device *dev)
}
device_unlock(dev);
- if (parent)
+}
+
+static void shutdown_one_device(struct device *dev)
+{
+ struct device *parent;
+
+ /* hold lock if needed to avoid race with probe/release */
+ if (dev->bus && dev->bus->need_parent_lock &&
+ (parent = get_device(dev->parent))) {
+ device_lock(parent);
+ __shutdown_one_device(dev);
device_unlock(parent);
+ put_device(parent);
+ } else {
+ __shutdown_one_device(dev);
+ }
- put_device(parent);
put_device(dev);
}
@@ -4853,12 +4861,6 @@ void device_shutdown(void)
dev = list_entry(devices_kset->list.prev, struct device,
kobj.entry);
- /*
- * hold reference count of device's parent to
- * prevent it from being freed because parent's
- * lock is to be held
- */
- get_device(dev->parent);
get_device(dev);
/*
* Make sure the device is off the kset list, in the
--
2.53.0
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH 3/5] driver core: async device shutdown infrastructure
2026-05-18 19:31 [PATCH v16 0/5] shut down devices asynchronously David Jeffery
2026-05-18 19:32 ` [PATCH 1/5] driver core: separate function to shutdown one device David Jeffery
2026-05-18 19:32 ` [PATCH 2/5] driver core: do not always lock parent in shutdown David Jeffery
@ 2026-05-18 19:32 ` David Jeffery
2026-05-18 19:32 ` [PATCH 4/5] PCI: Enable async shutdown support David Jeffery
` (2 subsequent siblings)
5 siblings, 0 replies; 8+ messages in thread
From: David Jeffery @ 2026-05-18 19:32 UTC (permalink / raw)
To: linux-kernel, driver-core, linux-pci, linux-scsi,
Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich
Cc: Tarun Sahu, Pasha Tatashin, Michał Cłapiński,
Jordan Richards, Ewan Milne, John Meneghini, Lombardi, Maurizio,
Stuart Hayes, Laurence Oberman, Bart Van Assche, Bjorn Helgaas,
Martin K . Petersen, John Garry, kexec, David Jeffery,
Pasha Tatashin
Patterned after async suspend, allow devices to mark themselves as wanting
to perform async shutdown. Devices using async shutdown wait only for their
dependencies to shutdown before executing their shutdown routine.
Sync shutdown devices are shut down one at a time and will only wait for an
async shutdown device if the async device is a dependency.
Enabled by default, async shutdown can be explicitly enabled or disabled
by using the kernel parameter "core.async_shutdown=<bool>"
Signed-off-by: David Jeffery <djeffery@redhat.com>
Signed-off-by: Stuart Hayes <stuart.w.hayes@gmail.com>
Tested-by: Laurence Oberman <loberman@redhat.com>
Tested-by: Tarun Sahu <tarunsahu@google.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Pasha Tatashin <pasha.tatashin@soleen.com>
---
.../admin-guide/kernel-parameters.txt | 10 ++
drivers/base/base.h | 2 +
drivers/base/core.c | 101 +++++++++++++++++-
include/linux/device.h | 2 +
4 files changed, 114 insertions(+), 1 deletion(-)
diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index b5a51a36a048..dd912f47ace4 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -1019,6 +1019,16 @@ Kernel parameters
seconds. A value of 0 disables the blank timer.
Defaults to 0.
+ core.async_shutdown=
+ [KNL]
+ Format: <bool>
+ Enable or disable asynchronous shutdown support. When
+ enabled, on system shutdown unrelated devices flagged
+ as async shutdown compatible may be shut down in
+ parallel and asynchronously. When disabled, device
+ shutdown is performed in a serially and synchronously.
+ Enabled by default.
+
coredump_filter=
[KNL] Change the default value for
/proc/<pid>/coredump_filter.
diff --git a/drivers/base/base.h b/drivers/base/base.h
index 483b99b4fa3d..aefa4f256d59 100644
--- a/drivers/base/base.h
+++ b/drivers/base/base.h
@@ -103,6 +103,7 @@ struct driver_private {
* dev_err_probe() for later retrieval via debugfs
* @device: pointer back to the struct device that this structure is
* associated with.
+ * @complete: completion for device shutdown ordering
* @dead: This device is currently either in the process of or has been
* removed from the system. Any asynchronous events scheduled for this
* device should exit without taking any action.
@@ -119,6 +120,7 @@ struct device_private {
const struct device_driver *async_driver;
char *deferred_probe_reason;
struct device *device;
+ struct completion complete;
u8 dead:1;
};
#define to_device_private_parent(obj) \
diff --git a/drivers/base/core.c b/drivers/base/core.c
index 6e2c37115bc1..cab10b0e70db 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -9,6 +9,7 @@
*/
#include <linux/acpi.h>
+#include <linux/async.h>
#include <linux/blkdev.h>
#include <linux/cleanup.h>
#include <linux/cpufreq.h>
@@ -37,6 +38,10 @@
#include "physical_location.h"
#include "power/power.h"
+static bool async_shutdown = true;
+module_param(async_shutdown, bool, 0644);
+MODULE_PARM_DESC(async_shutdown, "Enable asynchronous device shutdown support");
+
/* Device links support. */
static LIST_HEAD(deferred_sync);
static unsigned int defer_sync_state_count = 1;
@@ -3536,6 +3541,7 @@ static int device_private_init(struct device *dev)
klist_init(&dev->p->klist_children, klist_children_get,
klist_children_put);
INIT_LIST_HEAD(&dev->p->deferred_probe);
+ init_completion(&dev->p->complete);
return 0;
}
@@ -4795,6 +4801,37 @@ int device_change_owner(struct device *dev, kuid_t kuid, kgid_t kgid)
return error;
}
+static bool wants_async_shutdown(struct device *dev)
+{
+ return async_shutdown && dev_async_shutdown(dev);
+}
+
+static int wait_for_device_shutdown(struct device *dev, void *data)
+{
+ bool async = *(bool *)data;
+
+ if (async || wants_async_shutdown(dev))
+ wait_for_completion(&dev->p->complete);
+
+ return 0;
+}
+
+static void wait_for_shutdown_dependencies(struct device *dev, bool async)
+{
+ struct device_link *link;
+ int idx;
+
+ device_for_each_child(dev, &async, wait_for_device_shutdown);
+
+ idx = device_links_read_lock();
+
+ dev_for_each_link_to_consumer(link, dev)
+ if (!device_link_flag_is_sync_state_only(link->flags))
+ wait_for_device_shutdown(link->consumer, &async);
+
+ device_links_read_unlock(idx);
+}
+
static void __shutdown_one_device(struct device *dev)
{
device_lock(dev);
@@ -4818,6 +4855,8 @@ static void __shutdown_one_device(struct device *dev)
dev->driver->shutdown(dev);
}
+ complete_all(&dev->p->complete);
+
device_unlock(dev);
}
@@ -4839,6 +4878,55 @@ static void shutdown_one_device(struct device *dev)
put_device(dev);
}
+static void async_shutdown_handler(void *data, async_cookie_t cookie)
+{
+ struct device *dev = data;
+
+ wait_for_shutdown_dependencies(dev, true);
+ shutdown_one_device(dev);
+}
+
+static bool shutdown_device_async(struct device *dev)
+{
+ if (async_schedule_dev_nocall(async_shutdown_handler, dev))
+ return true;
+ return false;
+}
+
+
+static void early_async_shutdown_devices(void)
+{
+ struct device *dev, *next, *needs_put = NULL;
+
+ if (!async_shutdown)
+ return;
+
+ spin_lock(&devices_kset->list_lock);
+
+ list_for_each_entry_safe_reverse(dev, next, &devices_kset->list,
+ kobj.entry) {
+ if (wants_async_shutdown(dev)) {
+ get_device(dev);
+
+ if (shutdown_device_async(dev)) {
+ list_del_init(&dev->kobj.entry);
+ } else {
+ /*
+ * async failed, clean up extra references
+ * and run from the standard shutdown loop
+ */
+ needs_put = dev;
+ break;
+ }
+ }
+ }
+
+ spin_unlock(&devices_kset->list_lock);
+
+ if (needs_put)
+ put_device(needs_put);
+}
+
/**
* device_shutdown - call ->shutdown() on each device to shutdown.
*/
@@ -4851,6 +4939,12 @@ void device_shutdown(void)
cpufreq_suspend();
+ /*
+ * Start async device threads where possible to maximize potential
+ * parallelism and minimize false dependency on unrelated sync devices
+ */
+ early_async_shutdown_devices();
+
spin_lock(&devices_kset->list_lock);
/*
* Walk the devices list backward, shutting down each in turn.
@@ -4869,11 +4963,16 @@ void device_shutdown(void)
list_del_init(&dev->kobj.entry);
spin_unlock(&devices_kset->list_lock);
- shutdown_one_device(dev);
+ if (!wants_async_shutdown(dev) || !shutdown_device_async(dev)) {
+ wait_for_shutdown_dependencies(dev, false);
+ shutdown_one_device(dev);
+ }
spin_lock(&devices_kset->list_lock);
}
spin_unlock(&devices_kset->list_lock);
+
+ async_synchronize_full();
}
/*
diff --git a/include/linux/device.h b/include/linux/device.h
index d54c86d77764..0f2aeba34483 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -546,6 +546,7 @@ enum struct_device_flags {
DEV_FLAG_OF_NODE_REUSED = 7,
DEV_FLAG_OFFLINE_DISABLED = 8,
DEV_FLAG_OFFLINE = 9,
+ DEV_FLAG_ASYNC_SHUTDOWN = 10,
DEV_FLAG_COUNT
};
@@ -763,6 +764,7 @@ __create_dev_flag_accessors(dma_coherent, DEV_FLAG_DMA_COHERENT);
__create_dev_flag_accessors(of_node_reused, DEV_FLAG_OF_NODE_REUSED);
__create_dev_flag_accessors(offline_disabled, DEV_FLAG_OFFLINE_DISABLED);
__create_dev_flag_accessors(offline, DEV_FLAG_OFFLINE);
+__create_dev_flag_accessors(async_shutdown, DEV_FLAG_ASYNC_SHUTDOWN);
#undef __create_dev_flag_accessors
--
2.53.0
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH 4/5] PCI: Enable async shutdown support
2026-05-18 19:31 [PATCH v16 0/5] shut down devices asynchronously David Jeffery
` (2 preceding siblings ...)
2026-05-18 19:32 ` [PATCH 3/5] driver core: async device shutdown infrastructure David Jeffery
@ 2026-05-18 19:32 ` David Jeffery
2026-05-18 19:32 ` [PATCH 5/5] scsi: " David Jeffery
2026-06-01 15:09 ` [PATCH v16 0/5] shut down devices asynchronously Danilo Krummrich
5 siblings, 0 replies; 8+ messages in thread
From: David Jeffery @ 2026-05-18 19:32 UTC (permalink / raw)
To: linux-kernel, driver-core, linux-pci, linux-scsi,
Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich
Cc: Tarun Sahu, Pasha Tatashin, Michał Cłapiński,
Jordan Richards, Ewan Milne, John Meneghini, Lombardi, Maurizio,
Stuart Hayes, Laurence Oberman, Bart Van Assche, Bjorn Helgaas,
Martin K . Petersen, John Garry, kexec, David Jeffery,
Pasha Tatashin, Bjorn Helgaas
Like its async suspend support, allow PCI device shutdown to be performed
asynchronously to reduce shutdown time.
Signed-off-by: David Jeffery <djeffery@redhat.com>
Signed-off-by: Stuart Hayes <stuart.w.hayes@gmail.com>
Tested-by: Laurence Oberman <loberman@redhat.com>
Tested-by: Tarun Sahu <tarunsahu@google.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Pasha Tatashin <pasha.tatashin@soleen.com>
Reviewed-by: Bjorn Helgaas <bhelgaas@google.com>
---
drivers/pci/probe.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index b63cd0c310bc..7cf3dabc885e 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -1045,6 +1045,7 @@ static int pci_register_host_bridge(struct pci_host_bridge *bridge)
bus->bridge = get_device(&bridge->dev);
device_enable_async_suspend(bus->bridge);
+ dev_set_async_shutdown(bus->bridge);
pci_set_bus_of_node(bus);
pci_set_bus_msi_domain(bus);
if (bridge->msi_domain && !dev_get_msi_domain(&bus->dev) &&
@@ -2753,6 +2754,7 @@ void pci_device_add(struct pci_dev *dev, struct pci_bus *bus)
pci_reassigndev_resource_alignment(dev);
pci_init_capabilities(dev);
+ dev_set_async_shutdown(&dev->dev);
/*
* Add the device to our list of discovered devices
--
2.53.0
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH 5/5] scsi: Enable async shutdown support
2026-05-18 19:31 [PATCH v16 0/5] shut down devices asynchronously David Jeffery
` (3 preceding siblings ...)
2026-05-18 19:32 ` [PATCH 4/5] PCI: Enable async shutdown support David Jeffery
@ 2026-05-18 19:32 ` David Jeffery
2026-06-01 15:09 ` [PATCH v16 0/5] shut down devices asynchronously Danilo Krummrich
5 siblings, 0 replies; 8+ messages in thread
From: David Jeffery @ 2026-05-18 19:32 UTC (permalink / raw)
To: linux-kernel, driver-core, linux-pci, linux-scsi,
Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich
Cc: Tarun Sahu, Pasha Tatashin, Michał Cłapiński,
Jordan Richards, Ewan Milne, John Meneghini, Lombardi, Maurizio,
Stuart Hayes, Laurence Oberman, Bart Van Assche, Bjorn Helgaas,
Martin K . Petersen, John Garry, kexec, David Jeffery,
Pasha Tatashin
Like scsi's async suspend support, allow scsi devices to be shut down
asynchronously to reduce system shutdown time.
Signed-off-by: David Jeffery <djeffery@redhat.com>
Signed-off-by: Stuart Hayes <stuart.w.hayes@gmail.com>
Tested-by: Laurence Oberman <loberman@redhat.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Pasha Tatashin <pasha.tatashin@soleen.com>
Reviewed-by: John Garry <john.g.garry@oracle.com>
---
drivers/scsi/hosts.c | 2 ++
drivers/scsi/scsi_sysfs.c | 3 +++
2 files changed, 5 insertions(+)
diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c
index e047747d4ecf..bf691acc7a67 100644
--- a/drivers/scsi/hosts.c
+++ b/drivers/scsi/hosts.c
@@ -273,6 +273,7 @@ int scsi_add_host_with_dma(struct Scsi_Host *shost, struct device *dev,
pm_runtime_set_active(&shost->shost_gendev);
pm_runtime_enable(&shost->shost_gendev);
device_enable_async_suspend(&shost->shost_gendev);
+ dev_set_async_shutdown(&shost->shost_gendev);
error = device_add(&shost->shost_gendev);
if (error)
@@ -282,6 +283,7 @@ int scsi_add_host_with_dma(struct Scsi_Host *shost, struct device *dev,
get_device(shost->shost_gendev.parent);
device_enable_async_suspend(&shost->shost_dev);
+ dev_set_async_shutdown(&shost->shost_dev);
get_device(&shost->shost_gendev);
error = device_add(&shost->shost_dev);
diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
index dfc3559e7e04..8fd317aef37b 100644
--- a/drivers/scsi/scsi_sysfs.c
+++ b/drivers/scsi/scsi_sysfs.c
@@ -1386,6 +1386,7 @@ static int scsi_target_add(struct scsi_target *starget)
pm_runtime_set_active(&starget->dev);
pm_runtime_enable(&starget->dev);
device_enable_async_suspend(&starget->dev);
+ dev_set_async_shutdown(&starget->dev);
return 0;
}
@@ -1412,6 +1413,7 @@ int scsi_sysfs_add_sdev(struct scsi_device *sdev)
transport_configure_device(&starget->dev);
device_enable_async_suspend(&sdev->sdev_gendev);
+ dev_set_async_shutdown(&sdev->sdev_gendev);
scsi_autopm_get_target(starget);
pm_runtime_set_active(&sdev->sdev_gendev);
if (!sdev->rpm_autosuspend)
@@ -1431,6 +1433,7 @@ int scsi_sysfs_add_sdev(struct scsi_device *sdev)
}
device_enable_async_suspend(&sdev->sdev_dev);
+ dev_set_async_shutdown(&sdev->sdev_dev);
error = device_add(&sdev->sdev_dev);
if (error) {
sdev_printk(KERN_INFO, sdev,
--
2.53.0
^ permalink raw reply related [flat|nested] 8+ messages in thread* Re: [PATCH v16 0/5] shut down devices asynchronously
2026-05-18 19:31 [PATCH v16 0/5] shut down devices asynchronously David Jeffery
` (4 preceding siblings ...)
2026-05-18 19:32 ` [PATCH 5/5] scsi: " David Jeffery
@ 2026-06-01 15:09 ` Danilo Krummrich
2026-06-01 16:54 ` David Jeffery
5 siblings, 1 reply; 8+ messages in thread
From: Danilo Krummrich @ 2026-06-01 15:09 UTC (permalink / raw)
To: David Jeffery
Cc: linux-kernel, driver-core, linux-pci, linux-scsi,
Greg Kroah-Hartman, Rafael J. Wysocki, Tarun Sahu, Pasha Tatashin,
Michał Cłapiński, Jordan Richards, Ewan Milne,
John Meneghini, Lombardi, Maurizio, Stuart Hayes,
Laurence Oberman, Bart Van Assche, Bjorn Helgaas,
Martin K . Petersen, John Garry, kexec, James E.J. Bottomley
On Mon May 18, 2026 at 9:31 PM CEST, David Jeffery wrote:
> These patches are now rebased against the driver-core tree's driver-core-next
> branch.
[...]
> Changes from V15:
>
> The async_shutdown bit field is converted to a device flags bit Convert all
> patches to use the flag bit accessor macros to set or check if async shutdown
> should be used Added documentation on the kernel parameter to control use of
> async shutdown
Did you have a look at the Sashiko report from v15 [1]? Some of the concerns
raised seem valid at a quick glance.
(It seems that this version has not been picked up by Sashiko (despite you
mentioning they are based on driver-core-next). I'd assume it doesn't like that
the series was not sent with '--base'.)
Can you have a look at [1] please?
Thanks,
Danilo
[1] https://sashiko.dev/#/patchset/20260429175016.7915-1-djeffery%40redhat.com
> Stuart Hayes (2):
> driver core: separate function to shutdown one device
> driver core: do not always lock parent in shutdown
>
> David Jeffery (3):
> driver core: async device shutdown infrastructure
> PCI: Enable async shutdown support
> scsi: Enable async shutdown support
Not sure it will make it for 7.2, but I think it would be good to give this some
more time in linux-next anyways.
Bjorn, James, Martin:
Should the PCI and scsi patch go through the driver-core tree too?
Do you prefer a signed tag with the driver-core changes to merge into the PCI
and scsi trees?
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH v16 0/5] shut down devices asynchronously
2026-06-01 15:09 ` [PATCH v16 0/5] shut down devices asynchronously Danilo Krummrich
@ 2026-06-01 16:54 ` David Jeffery
0 siblings, 0 replies; 8+ messages in thread
From: David Jeffery @ 2026-06-01 16:54 UTC (permalink / raw)
To: Danilo Krummrich
Cc: linux-kernel, driver-core, linux-pci, linux-scsi,
Greg Kroah-Hartman, Rafael J. Wysocki, Tarun Sahu, Pasha Tatashin,
Michał Cłapiński, Jordan Richards, Ewan Milne,
John Meneghini, Lombardi, Maurizio, Stuart Hayes,
Laurence Oberman, Bart Van Assche, Bjorn Helgaas,
Martin K . Petersen, John Garry, kexec, James E.J. Bottomley
On Mon, Jun 1, 2026 at 11:10 AM Danilo Krummrich <dakr@kernel.org> wrote:
>
> On Mon May 18, 2026 at 9:31 PM CEST, David Jeffery wrote:
> > These patches are now rebased against the driver-core tree's driver-core-next
> > branch.
>
> [...]
>
> > Changes from V15:
> >
> > The async_shutdown bit field is converted to a device flags bit Convert all
> > patches to use the flag bit accessor macros to set or check if async shutdown
> > should be used Added documentation on the kernel parameter to control use of
> > async shutdown
>
> Did you have a look at the Sashiko report from v15 [1]? Some of the concerns
> raised seem valid at a quick glance.
>
> (It seems that this version has not been picked up by Sashiko (despite you
> mentioning they are based on driver-core-next). I'd assume it doesn't like that
> the series was not sent with '--base'.)
>
> Can you have a look at [1] please?
>
> Thanks,
> Danilo
>
> [1] https://sashiko.dev/#/patchset/20260429175016.7915-1-djeffery%40redhat.com
This does look to have found some legitimate issues in need of
correction. I'll get them fixed.
Thanks,
David Jeffery
^ permalink raw reply [flat|nested] 8+ messages in thread