[PATCH v6 25/30] PNP: Don't reserve BARs for PCI when enabled movable BARs

Sergey Miroshnichenko s.miroshnichenko at yadro.com
Fri Oct 25 04:12:23 AEDT 2019


When the Movable BARs feature is supported, the PCI subsystem is able to
distribute existing BARs and allocate the new ones itself, without need to
reserve gaps by BIOS.

CC: Rafael J. Wysocki <rafael.j.wysocki at intel.com>
Signed-off-by: Sergey Miroshnichenko <s.miroshnichenko at yadro.com>
---
 drivers/pnp/system.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/pnp/system.c b/drivers/pnp/system.c
index 6950503741eb..5977bd11f4d4 100644
--- a/drivers/pnp/system.c
+++ b/drivers/pnp/system.c
@@ -12,6 +12,7 @@
 #include <linux/device.h>
 #include <linux/init.h>
 #include <linux/slab.h>
+#include <linux/pci.h>
 #include <linux/kernel.h>
 #include <linux/ioport.h>
 
@@ -58,6 +59,9 @@ static void reserve_resources_of_dev(struct pnp_dev *dev)
 	struct resource *res;
 	int i;
 
+	if (pci_can_move_bars)
+		return;
+
 	for (i = 0; (res = pnp_get_resource(dev, IORESOURCE_IO, i)); i++) {
 		if (res->flags & IORESOURCE_DISABLED)
 			continue;
-- 
2.23.0



More information about the Linuxppc-dev mailing list