Re: [PATCH 4/5] pci: enable async shutdown support

David Jeffery
2026-03-12T13:54:31Z

On Thu, Mar 12, 2026 at 1:09 AM Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
>
> On Wed, Mar 11, 2026 at 01:12:08PM -0400, David Jeffery wrote:
> > Like its async suspend support, allow pci device shutdown to be performed
> > asynchronously to improve 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>
> > ---
> > drivers/pci/probe.c | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
> > index bccc7a4bdd79..4d98bab2163d 100644
> > --- a/drivers/pci/probe.c
> > +++ b/drivers/pci/probe.c
> > @@ -1040,6 +1040,7 @@ static int pci_register_host_bridge(struct pci_host_bridge *bridge)
> >
> > bus->bridge = get_device(&bridge->dev);
> > device_enable_async_suspend(bus->bridge);
> > + device_enable_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) &&
> > @@ -2749,6 +2750,7 @@ void pci_device_add(struct pci_dev *dev, struct pci_bus *bus)
> > pci_reassigndev_resource_alignment(dev);
> >
> > pci_init_capabilities(dev);
> > + device_enable_async_shutdown(&dev->dev);
>
> For all PCI devices? Are you sure this is ok? That feels like it is
> going to be ripe with race conditions...

I did not see or find any issues. PCI already enables async suspend on
all devices, it just does so in a power management specific function
so I didn't put device_enable_async_shutdown next to the
device_enable_async_suspend call.

> How was this tested?

It has been running on various VMs and x86_64 physical machines.

> thanks,
>
> greg k-h
>

David Jeffery