Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F115684580
D43921.id134390.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D43921.id134390.diff
View Options
diff --git a/sys/dev/pci/pci_host_generic.c b/sys/dev/pci/pci_host_generic.c
--- a/sys/dev/pci/pci_host_generic.c
+++ b/sys/dev/pci/pci_host_generic.c
@@ -59,6 +59,12 @@
#define PCI_RF_FLAGS 0
#endif
+/*
+ * We allocate "ranges" specified mappings higher up in the rid space to avoid
+ * conflicts with various definitions in the wild that may have other registers
+ * attributed to the controller besides just the config space.
+ */
+#define RANGE_RID(idx) ((idx) + 100)
/* Forward prototypes */
@@ -173,7 +179,7 @@
phys_base = sc->ranges[tuple].phys_base;
pci_base = sc->ranges[tuple].pci_base;
size = sc->ranges[tuple].size;
- rid = tuple + 1;
+ rid = RANGE_RID(tuple);
if (size == 0)
continue; /* empty range element */
switch (FLAG_TYPE(sc->ranges[tuple].flags)) {
@@ -238,9 +244,9 @@
continue;
}
if (sc->ranges[tuple].res != NULL)
- bus_release_resource(dev, type, tuple + 1,
+ bus_release_resource(dev, type, RANGE_RID(tuple),
sc->ranges[tuple].res);
- bus_delete_resource(dev, type, tuple + 1);
+ bus_delete_resource(dev, type, RANGE_RID(tuple));
}
rman_fini(&sc->io_rman);
err_io_rman:
@@ -285,9 +291,9 @@
continue;
}
if (sc->ranges[tuple].res != NULL)
- bus_release_resource(dev, type, tuple + 1,
+ bus_release_resource(dev, type, RANGE_RID(tuple),
sc->ranges[tuple].res);
- bus_delete_resource(dev, type, tuple + 1);
+ bus_delete_resource(dev, type, RANGE_RID(tuple));
}
rman_fini(&sc->io_rman);
rman_fini(&sc->mem_rman);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Apr 28, 2:50 AM (14 h, 52 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
17824777
Default Alt Text
D43921.id134390.diff (1 KB)
Attached To
Mode
D43921: pci: avoid accidental clobbering of regs on some fdt platforms
Attached
Detach File
Event Timeline
Log In to Comment