]> www.infradead.org Git - users/jedix/linux-maple.git/commit
PCI: Increment PM usage counter when probing reset methods
authorAlex Williamson <alex.williamson@redhat.com>
Tue, 22 Apr 2025 23:05:32 +0000 (17:05 -0600)
committerBjorn Helgaas <bhelgaas@google.com>
Wed, 23 Apr 2025 21:06:45 +0000 (16:06 -0500)
commit0a0829b1fd76cb6110cc049a60e634a51969e488
tree56aca90f89c05a1f9d4677972152f2475f6bcdb0
parentbfa4477751e9909bb121eca860f44d1b4259d871
PCI: Increment PM usage counter when probing reset methods

We can get different results probing reset methods for a device depending
on its power state.  For example, reading the PM control register of a
device in D3cold will always indicate NoSoftRst+ because we get ~0 data
when the config read fails on PCI, preventing us from correctly probing PM
reset support.

Increment the PM usage counter before any probes and use the cleanup __free
facility to automatically drop the usage counter out of scope.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Link: https://patch.msgid.link/20250422230534.2295291-3-alex.williamson@redhat.com
drivers/pci/pci-sysfs.c