diff options
author | Keith Busch <[email protected]> | 2024-10-25 15:27:55 -0700 |
---|---|---|
committer | Bjorn Helgaas <[email protected]> | 2024-11-13 16:48:49 -0600 |
commit | a3151e6daaec171b7d46ac79170ec420ad874cae (patch) | |
tree | 04e4f66b4be38e3abdd74148500a86abe17390bb | |
parent | 2fa046449a82a7d0f6d9721dd83e348816038444 (diff) |
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/[email protected]
Signed-off-by: Keith Busch <[email protected]>
Signed-off-by: Bjorn Helgaas <[email protected]>
Reviewed-by: Amey Narkhede <[email protected]>
Reviewed-by: Alex Williamson <[email protected]>
-rw-r--r-- | drivers/pci/pci.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 338dfcd983f1..bbf12d499826 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -5158,6 +5158,8 @@ static void pci_dev_save_and_disable(struct pci_dev *dev) */ if (err_handler && err_handler->reset_prepare) err_handler->reset_prepare(dev); + else if (dev->driver) + pci_warn(dev, "resetting"); /* * 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) */ if (err_handler && err_handler->reset_done) err_handler->reset_done(dev); + else if (dev->driver) + pci_warn(dev, "reset done"); } /* dev->reset_methods[] is a 0-terminated list of indices into this array */ |