summaryrefslogtreecommitdiffstats
path: root/sys/dev/cardbus
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2009-12-30 20:49:13 +0000
committerjhb <jhb@FreeBSD.org>2009-12-30 20:49:13 +0000
commit05e668091314a2bdc6f8d36ac2e8abf4c424a09a (patch)
treef96941bc105604f38f48155a768eb9578aa30788 /sys/dev/cardbus
parent9b53c8050d11d206fc12ee51b23d56389bd41bd3 (diff)
downloadFreeBSD-src-05e668091314a2bdc6f8d36ac2e8abf4c424a09a.zip
FreeBSD-src-05e668091314a2bdc6f8d36ac2e8abf4c424a09a.tar.gz
Delete the CIS resource after releasing it. This is needed when the CIS is
stored in a BAR since the CIS BAR is mapped before the PCI bus driver enumerates all the BARs. Without this change, the PCI bus driver would attempt to initialize a BAR that was already allocated resulting in a panic.
Diffstat (limited to 'sys/dev/cardbus')
-rw-r--r--sys/dev/cardbus/cardbus_cis.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/dev/cardbus/cardbus_cis.c b/sys/dev/cardbus/cardbus_cis.c
index 5e52c3b..781d399 100644
--- a/sys/dev/cardbus/cardbus_cis.c
+++ b/sys/dev/cardbus/cardbus_cis.c
@@ -430,6 +430,7 @@ cardbus_read_tuple_finish(device_t cbdev, device_t child, int rid,
{
if (res != CIS_CONFIG_SPACE) {
bus_release_resource(child, SYS_RES_MEMORY, rid, res);
+ bus_delete_resource(child, SYS_RES_MEMORY, rid);
}
}
@@ -492,8 +493,8 @@ cardbus_read_tuple_init(device_t cbdev, device_t child, uint32_t *start,
device_printf(cbdev, "Bad header in rom %d: "
"[%x] %04x\n", romnum, imagebase +
CARDBUS_EXROM_SIGNATURE, romsig);
- bus_release_resource(child, SYS_RES_MEMORY,
- *rid, res);
+ cardbus_read_tuple_finish(cbdev, child, *rid,
+ res);
*rid = 0;
return (NULL);
}
OpenPOWER on IntegriCloud