summaryrefslogtreecommitdiffstats
path: root/sys/sys/bus.h
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2013-06-27 20:21:54 +0000
committerjhb <jhb@FreeBSD.org>2013-06-27 20:21:54 +0000
commitc1207dc20cfb10830a48d20d77f7a913d7a96029 (patch)
tree69d881f3333bd86e947935bed15eb731c8b66001 /sys/sys/bus.h
parent823196e2536bd8942ccac6fbac1ee337562c4623 (diff)
downloadFreeBSD-src-c1207dc20cfb10830a48d20d77f7a913d7a96029.zip
FreeBSD-src-c1207dc20cfb10830a48d20d77f7a913d7a96029.tar.gz
Make detaching drivers from PCI devices more robust. While here, fix a
bug where a PCI device would be powered down if it failed to probe, but not when its driver was detached (e.g. via kldunload). - Add a new helper method resource_list_release_active() which forcefully releases any active resources of a specified type from a resource list. - Add a bus_child_detached method for the PCI bus driver which forces any active resources to be released (and whines to the console if it finds any) and then powers the device down. - Call pci_child_detached() if we fail to probe a device when a driver is kldloaded. This isn't perfect but can avoid leaking resources from a probe() routine in the kldload case. Reviewed by: imp, brooks MFC after: 1 month
Diffstat (limited to 'sys/sys/bus.h')
-rw-r--r--sys/sys/bus.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/sys/bus.h b/sys/sys/bus.h
index 152b067..06e0f6c 100644
--- a/sys/sys/bus.h
+++ b/sys/sys/bus.h
@@ -273,6 +273,9 @@ struct resource *
int resource_list_release(struct resource_list *rl,
device_t bus, device_t child,
int type, int rid, struct resource *res);
+int resource_list_release_active(struct resource_list *rl,
+ device_t bus, device_t child,
+ int type);
struct resource *
resource_list_reserve(struct resource_list *rl,
device_t bus, device_t child,
OpenPOWER on IntegriCloud