summaryrefslogtreecommitdiffstats
path: root/include/linux/overflow.h
diff options
context:
space:
mode:
authorIlpo Järvinen <ilpo.jarvinen@linux.intel.com>2025-04-03 12:31:37 +0300
committerBjorn Helgaas <bhelgaas@google.com>2025-04-18 08:23:22 -0500
commita34d74877c66ce484ad586d806002ceaedd58657 (patch)
treedca171651cd1a5b6651d6de1553b2792a5bac93d /include/linux/overflow.h
parent0af2f6be1b4281385b618cb86ad946eded089ac8 (diff)
downloadlinux-a34d74877c66ce484ad586d806002ceaedd58657.tar.gz
linux-a34d74877c66ce484ad586d806002ceaedd58657.tar.bz2
linux-a34d74877c66ce484ad586d806002ceaedd58657.zip
PCI: Restore assigned resources fully after release
PCI resource fitting code in __assign_resources_sorted() runs in multiple steps. A resource that was successfully assigned may have to be released before the next step attempts assignment again. The assign+release cycle is destructive to a start-aligned struct resource (bridge window or IOV resource) because the start field is overwritten with the real address when the resource got assigned. One symptom: pci 0002:00:00.0: bridge window [mem size 0x00100000]: can't assign; bogus alignment Properly restore the resource after releasing it. The start, end, and flags fields must be stored into the related struct pci_dev_resource in order to be able to restore the resource to its original state. Fixes: 96336ec70264 ("PCI: Perform reset_resource() and build fail list in sync") Reported-by: Guenter Roeck <linux@roeck-us.net> Closes: https://lore.kernel.org/r/01eb7d40-f5b5-4ec5-b390-a5c042c30aff@roeck-us.net/ Reported-by: Nicolas Frattaroli <nicolas.frattaroli@collabora.com> Closes: https://lore.kernel.org/r/3578030.5fSG56mABF@workhorse Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Tested-by: Nicolas Frattaroli <nicolas.frattaroli@collabora.com> Tested-by: Guenter Roeck <linux@roeck-us.net> Tested-by: Ondrej Jirman <megi@xff.cz> Link: https://patch.msgid.link/20250403093137.1481-1-ilpo.jarvinen@linux.intel.com
Diffstat (limited to 'include/linux/overflow.h')
0 files changed, 0 insertions, 0 deletions