Skip to content

Commit a3151e6

Browse files
keithbuschbjorn-helgaas
authored andcommitted
PCI: Warn if a running device is unaware of reset
If a reset is issued to a running device with a driver that didn't register the notification callbacks, the driver may be unaware of this event and have an inconsistent view of the device's state. Log a warning of this event because there's nothing else indicating the event occured, which could be confusing when debugging such situations. Link: https://lore.kernel.org/r/20241025222755.3756162-2-kbusch@meta.com Signed-off-by: Keith Busch <kbusch@kernel.org> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Amey Narkhede <ameynarkhede03@gmail.com> Reviewed-by: Alex Williamson <alex.williamson@redhat.com>
1 parent 2fa0464 commit a3151e6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/pci/pci.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5158,6 +5158,8 @@ static void pci_dev_save_and_disable(struct pci_dev *dev)
51585158
*/
51595159
if (err_handler && err_handler->reset_prepare)
51605160
err_handler->reset_prepare(dev);
5161+
else if (dev->driver)
5162+
pci_warn(dev, "resetting");
51615163

51625164
/*
51635165
* Wake-up device prior to save. PM registers default to D0 after
@@ -5191,6 +5193,8 @@ static void pci_dev_restore(struct pci_dev *dev)
51915193
*/
51925194
if (err_handler && err_handler->reset_done)
51935195
err_handler->reset_done(dev);
5196+
else if (dev->driver)
5197+
pci_warn(dev, "reset done");
51945198
}
51955199

51965200
/* dev->reset_methods[] is a 0-terminated list of indices into this array */

0 commit comments

Comments
 (0)