Thread (20 messages) flat view 20 messages, 4 authors, 2015-10-06

Re: [PATCH v4 3/5] PCI: Handle IORESOURCE_PCI_FIXED when sizing and assigning resources.

From: Sean O. Stalley <hidden>
Date: 2015-10-05 22:26:53
Also in: linux-pci, lkml

On Fri, Oct 02, 2015 at 03:37:54PM -0700, David Daney wrote:

...
+/*
+ * Try to assign any resources marked as IORESOURCE_PCI_FIXED, as they
+ * are skipped by pbus_assign_resources_sorted().
+ */
+static void pdev_assign_fixed_resources(struct pci_dev *dev)
+{
+	int i;
+
+	for (i = 0; i <  PCI_NUM_RESOURCES; i++) {
+		struct pci_bus *b;
+		struct resource *r = &dev->resource[i];
+
+		if (r->parent || !(r->flags & IORESOURCE_PCI_FIXED) ||
+		    !(r->flags & (IORESOURCE_IO | IORESOURCE_MEM)))
+			continue;
+
+		b = dev->bus;
+		while (b && !r->parent) {
+			assign_fixed_resource_on_bus(b, r);
+			b = b->parent;
+		}
+		if (!r->parent) {
+			/*
+			 * If that didn't work, try to fallback to the
+			 * ultimate parent.
+			 */
+			if (r->flags &  IORESOURCE_IO)
+				request_resource(&ioport_resource, r);
+			else
+				request_resource(&iomem_resource, r);
+		}
I don't think this check is necessary.
assign_fixed_resource_on_bus() should find these resources when it reaches the top bus.
(since since the root bus contains these resources).
+	}
+}
-Sean
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help