new-bus: Disable assertions for rman mismatches for activate/deactivate

Bus drivers which use an rman to sub-divide a resource allocated from
a parent bus should handle mapping requests (and activate/deactivate
requests) for those sub-allocated resources by doing a subset mapping
of the resource allocated from the parent (and then using this to
handle activate/deactivate requests).

However, not all bus drivers which use internal rmans (such as acpi(4)
and pci_pci(4)) do that since not all nexus drivers support
bus_map/unmap.  Eventually bus drivers should be updated to do this
properly at which point these assertions can be reenabled.

Reported by:	delphij, kib

(cherry picked from commit ed88eef140a1c3d57d546f409c216806dd3da809)
This commit is contained in:
John Baldwin 2023-11-25 10:32:19 -08:00
parent 0c7aa9afb1
commit 92991e8f8d

View file

@ -4305,12 +4305,12 @@ bus_generic_rman_activate_resource(device_t dev, device_t child, int type,
int rid, struct resource *r)
{
struct resource_map map;
#ifdef INVARIANTS
#ifdef INVARIANTS_XXX
struct rman *rm;
#endif
int error;
#ifdef INVARIANTS
#ifdef INVARIANTS_XXX
rm = BUS_GET_RMAN(dev, type, rman_get_flags(r));
KASSERT(rman_is_region_manager(r, rm),
("%s: rman %p doesn't match for resource %p", __func__, rm, r));
@ -4344,12 +4344,12 @@ bus_generic_rman_deactivate_resource(device_t dev, device_t child, int type,
int rid, struct resource *r)
{
struct resource_map map;
#ifdef INVARIANTS
#ifdef INVARIANTS_XXX
struct rman *rm;
#endif
int error;
#ifdef INVARIANTS
#ifdef INVARIANTS_XXX
rm = BUS_GET_RMAN(dev, type, rman_get_flags(r));
KASSERT(rman_is_region_manager(r, rm),
("%s: rman %p doesn't match for resource %p", __func__, rm, r));