Make sure to remap adjusted resources.

This commit is contained in:
Nathan Whitehorn 2012-02-05 16:54:26 +00:00
parent 9077f38738
commit bc890e542e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=231026

View File

@ -431,6 +431,7 @@ ofw_pci_adjust_resource(device_t bus, device_t child, int type,
{
struct rman *rm = NULL;
struct ofw_pci_softc *sc = device_get_softc(bus);
int error;
switch (type) {
case SYS_RES_MEMORY:
@ -445,7 +446,22 @@ ofw_pci_adjust_resource(device_t bus, device_t child, int type,
if (!rman_is_region_manager(res, rm))
return (EINVAL);
return (rman_adjust_resource(res, start, end));
error = rman_adjust_resource(res, start, end);
if (error)
return (error);
if (rman_get_flags(res) & RF_ACTIVE) {
/* Remap memory resources */
error = ofw_pci_deactivate_resource(bus, child, type,
rman_get_rid(res), res);
if (error)
return (error);
error = ofw_pci_activate_resource(bus, child, type,
rman_get_rid(res), res);
}
return (error);
}