git: a69089343057 - stable/14 - sys: Set the type of allocated bus resources
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 27 Feb 2025 14:17:18 UTC
The branch stable/14 has been updated by jhb:
URL: https://cgit.FreeBSD.org/src/commit/?id=a69089343057c837c9fd6f7ae6e67a73c2f91983
commit a69089343057c837c9fd6f7ae6e67a73c2f91983
Author: John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2024-03-13 22:05:53 +0000
Commit: John Baldwin <jhb@FreeBSD.org>
CommitDate: 2025-02-27 13:09:23 +0000
sys: Set the type of allocated bus resources
Use rman_set_type to set the type of allocated resources everywhere
rman_set_rid is currently called.
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D44123
(cherry picked from commit 1b9bcffff39a817b77401d1b975f374781adfaf8)
---
sys/dev/bhnd/bhndb/bhndb.c | 1 +
sys/dev/dpaa/fman.c | 1 +
sys/dev/pci/pci_iov.c | 1 +
sys/dev/pci/pci_pci.c | 2 ++
sys/dev/pci/pci_subr.c | 1 +
sys/kern/subr_bus.c | 1 +
6 files changed, 7 insertions(+)
diff --git a/sys/dev/bhnd/bhndb/bhndb.c b/sys/dev/bhnd/bhndb/bhndb.c
index 4e631f85b3b6..978ad9c3e62b 100644
--- a/sys/dev/bhnd/bhndb/bhndb.c
+++ b/sys/dev/bhnd/bhndb/bhndb.c
@@ -1005,6 +1005,7 @@ bhndb_alloc_resource(device_t dev, device_t child, int type,
return (NULL);
rman_set_rid(rv, *rid);
+ rman_set_type(rv, type);
/* Activate */
if (flags & RF_ACTIVE) {
diff --git a/sys/dev/dpaa/fman.c b/sys/dev/dpaa/fman.c
index 7b82a0fbc1fd..f14ca45e1fc1 100644
--- a/sys/dev/dpaa/fman.c
+++ b/sys/dev/dpaa/fman.c
@@ -192,6 +192,7 @@ fman_alloc_resource(device_t bus, device_t child, int type, int *rid,
if (res == NULL)
return (NULL);
rman_set_rid(res, *rid);
+ rman_set_type(res, type);
if ((flags & RF_ACTIVE) != 0 && bus_activate_resource(
child, type, *rid, res) != 0) {
rman_release_resource(res);
diff --git a/sys/dev/pci/pci_iov.c b/sys/dev/pci/pci_iov.c
index 60325e8cd491..ee1387966b00 100644
--- a/sys/dev/pci/pci_iov.c
+++ b/sys/dev/pci/pci_iov.c
@@ -1050,6 +1050,7 @@ pci_vf_alloc_mem_resource(device_t dev, device_t child, int *rid,
}
rman_set_rid(res, *rid);
+ rman_set_type(res, SYS_RES_MEMORY);
if (flags & RF_ACTIVE) {
error = bus_activate_resource(child, SYS_RES_MEMORY, *rid, res);
diff --git a/sys/dev/pci/pci_pci.c b/sys/dev/pci/pci_pci.c
index cda1597ac76e..68eab2a6633b 100644
--- a/sys/dev/pci/pci_pci.c
+++ b/sys/dev/pci/pci_pci.c
@@ -727,6 +727,7 @@ pcib_suballoc_bus(struct pcib_secbus *bus, device_t child, int *rid,
rman_get_start(res), rman_get_end(res), *rid,
pcib_child_name(child));
rman_set_rid(res, *rid);
+ rman_set_type(res, PCI_RES_BUS);
return (res);
}
@@ -1930,6 +1931,7 @@ pcib_suballoc_resource(struct pcib_softc *sc, struct pcib_window *w,
w->name, rman_get_start(res), rman_get_end(res), *rid,
pcib_child_name(child));
rman_set_rid(res, *rid);
+ rman_set_type(res, type);
if (flags & RF_ACTIVE) {
if (bus_activate_resource(child, type, *rid, res) != 0) {
diff --git a/sys/dev/pci/pci_subr.c b/sys/dev/pci/pci_subr.c
index d0f6c9500b17..e2583a75e303 100644
--- a/sys/dev/pci/pci_subr.c
+++ b/sys/dev/pci/pci_subr.c
@@ -344,6 +344,7 @@ pci_domain_alloc_bus(int domain, device_t dev, int *rid, rman_res_t start,
return (NULL);
rman_set_rid(res, *rid);
+ rman_set_type(res, PCI_RES_BUS);
return (res);
}
diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c
index bd54977cc6f1..ffad54c34925 100644
--- a/sys/kern/subr_bus.c
+++ b/sys/kern/subr_bus.c
@@ -4305,6 +4305,7 @@ bus_generic_rman_alloc_resource(device_t dev, device_t child, int type,
if (r == NULL)
return (NULL);
rman_set_rid(r, *rid);
+ rman_set_type(r, type);
if (flags & RF_ACTIVE) {
if (bus_activate_resource(child, type, *rid, r) != 0) {