aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2014-01-20 17:55:22 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2014-01-20 17:55:22 +0000
commit2f0df38779485ad0ab0de65580036c0ae41f4167 (patch)
tree9bcda6f6db569acb6d5775230edd1b0d09354b11
parent138277120cbc4a2852b3b6d0ca20d0357599ffce (diff)
Notes
-rw-r--r--sys/x86/x86/nexus.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/x86/x86/nexus.c b/sys/x86/x86/nexus.c
index 9ead8c842caeb..f74299cf43517 100644
--- a/sys/x86/x86/nexus.c
+++ b/sys/x86/x86/nexus.c
@@ -368,12 +368,13 @@ nexus_alloc_resource(device_t bus, device_t child, int type, int *rid,
int needactivate = flags & RF_ACTIVE;
/*
- * If this is an allocation of the "default" range for a given RID, and
- * we know what the resources for this device are (ie. they aren't maintained
- * by a child bus), then work out the start/end values.
+ * If this is an allocation of the "default" range for a given
+ * RID, and we know what the resources for this device are
+ * (ie. they aren't maintained by a child bus), then work out
+ * the start/end values.
*/
if ((start == 0UL) && (end == ~0UL) && (count == 1)) {
- if (ndev == NULL)
+ if (device_get_parent(child) != bus || ndev == NULL)
return(NULL);
rle = resource_list_find(&ndev->nx_resources, type, *rid);
if (rle == NULL)
@@ -492,6 +493,7 @@ static int
nexus_release_resource(device_t bus, device_t child, int type, int rid,
struct resource *r)
{
+
if (rman_get_flags(r) & RF_ACTIVE) {
int error = bus_deactivate_resource(child, type, rid, r);
if (error)