summaryrefslogtreecommitdiffstats
path: root/sys/dev/pccard
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2001-01-07 21:32:05 +0000
committerpeter <peter@FreeBSD.org>2001-01-07 21:32:05 +0000
commit7ffba1700e1b418936dbb45702b26eb9df1e82f1 (patch)
tree64ce6b6227eb19003e26ff01ab8535cae7a61bb8 /sys/dev/pccard
parent98a14853d90aeca5871b2412955bbed2d3d9e06b (diff)
downloadFreeBSD-src-7ffba1700e1b418936dbb45702b26eb9df1e82f1.zip
FreeBSD-src-7ffba1700e1b418936dbb45702b26eb9df1e82f1.tar.gz
This is a bandaid for a problem that is not entirely fixed yet.
The pccard_function_init() call creates a bunch of inactive resources that are persistant and configured on demand. When the child driver "allocates" a resource it is connected up to one of these. When the child releases the resource, we should not delete our copy, just deactivate it again. Otherwise there is nothing to recreate it again after several probe functions have run and done an alloc/release cycle. INVARIANTS shows 0xdeadc0de without this. More work is needed to do a sweep though the pccard_function_disable() call to actually delete the resources for real. Right now, we leak memory on eject (at best), so Dont Do That(TM) yet. This affects 16 bit pccards on a cardbus bridge only. This will be fixed soon, but for now it gets the cards working. Reviewed by: imp
Diffstat (limited to 'sys/dev/pccard')
-rw-r--r--sys/dev/pccard/pccard.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/dev/pccard/pccard.c b/sys/dev/pccard/pccard.c
index b94f4fb..53aaca0 100644
--- a/sys/dev/pccard/pccard.c
+++ b/sys/dev/pccard/pccard.c
@@ -213,6 +213,10 @@ pccard_detach_card(device_t dev, int flags)
continue;
pccard_function_disable(pf);
+ /*
+ * XXX must also actually delete resources created by
+ * pccard_function_init()
+ */
if (pf->dev)
device_delete_child(dev, pf->dev);
}
@@ -940,7 +944,7 @@ pccard_release_resource(device_t dev, device_t child, int type, int rid,
}
if (rle != NULL) {
- return bus_release_resource(dev, type, rle->rid, rle->res);
+ return bus_deactivate_resource(dev, type, rle->rid, rle->res);
}
return bus_generic_release_resource(dev, child, type, rid, r);
OpenPOWER on IntegriCloud