diff options
| author | Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> | 2025-11-13 18:26:28 +0200 |
|---|---|---|
| committer | Bjorn Helgaas <bhelgaas@google.com> | 2025-11-14 12:34:20 -0600 |
| commit | 7409c1b12c5b11157d10108db644bd39c0a99426 (patch) | |
| tree | dd3b3294bdf9340edcf7980cc529b94f09d40f36 /tools/lib/python/kdoc/kdoc_parser.py | |
| parent | db92e3fef53e2083001dcc4c86a3ecff4ab4dc4e (diff) | |
PCI: Prevent restoring assigned resources
restore_dev_resource() copies saved addresses and flags from the struct
pci_dev_resource back to the struct resource, typically, during rollback
from a failure or in preparation for a retry attempt.
If the resource is within resource tree, the resource must not be
modified as the resource tree could be corrupted. Thus, it's a bug to
call restore_dev_resource() for assigned resources (which did happen
due to logic flaws in the BAR resize rollback).
Add WARN_ON_ONCE() into restore_dev_resource() to detect such bugs easily
and return without altering the resource to prevent corruption.
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Tested-by: Alex Bennée <alex.bennee@linaro.org> # AVA, AMD GPU
Link: https://patch.msgid.link/20251113162628.5946-12-ilpo.jarvinen@linux.intel.com
Diffstat (limited to 'tools/lib/python/kdoc/kdoc_parser.py')
0 files changed, 0 insertions, 0 deletions
