diff options
-rw-r--r-- | sys/kern/subr_bus.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index 8c2db32..1689505 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -2898,8 +2898,11 @@ resource_list_busy(struct resource_list *rl, int type, int rid) rle = resource_list_find(rl, type, rid); if (rle == NULL || rle->res == NULL) return (0); - if ((rle->flags & (RLE_RESERVED | RLE_ALLOCATED)) == RLE_RESERVED) + if ((rle->flags & (RLE_RESERVED | RLE_ALLOCATED)) == RLE_RESERVED) { + KASSERT(!(rman_get_flags(rle->res) & RF_ACTIVE), + ("reserved resource is active")); return (0); + } return (1); } @@ -3801,6 +3804,10 @@ bus_generic_rl_release_resource(device_t dev, device_t child, int type, { struct resource_list * rl = NULL; + if (device_get_parent(child) != dev) + return (BUS_RELEASE_RESOURCE(device_get_parent(dev), child, + type, rid, r)); + rl = BUS_GET_RESOURCE_LIST(dev, child); if (!rl) return (EINVAL); @@ -3821,6 +3828,10 @@ bus_generic_rl_alloc_resource(device_t dev, device_t child, int type, { struct resource_list * rl = NULL; + if (device_get_parent(child) != dev) + return (BUS_ALLOC_RESOURCE(device_get_parent(dev), child, + type, rid, start, end, count, flags)); + rl = BUS_GET_RESOURCE_LIST(dev, child); if (!rl) return (NULL); |