diff mbox series

[5/6] PCI: don't reassign resources that are already aligned

Message ID 20240709133610.1089420-6-stewart.hildebrand@amd.com
State New
Headers show
Series PCI: align small (<4k) BARs | expand

Commit Message

Stewart Hildebrand July 9, 2024, 1:36 p.m. UTC
As a follow-up to commit 0dde1c08d1b9 ("PCI: Don't reassign resources
that are already aligned"), don't reassign already aligned resources
that have requested alignment without resizing.

Signed-off-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
---
 drivers/pci/pci.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 7953e75b9129..9f7894538334 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -6553,6 +6553,9 @@  static void pci_request_resource_alignment(struct pci_dev *dev, int bar,
 	if (size >= align)
 		return;
 
+	if (!resize && (r->start > align) && !(r->start & (align - 1)))
+		return;
+
 	/*
 	 * Increase the alignment of the resource.  There are two ways we
 	 * can do this: