aboutsummaryrefslogtreecommitdiff
path: root/sys/xen
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2021-12-10 00:04:45 +0000
committerWarner Losh <imp@FreeBSD.org>2021-12-10 00:04:45 +0000
commitc6df6f5322f7004c71216391e1c0b374d853704a (patch)
tree76dc82f3e59048e11fc12a9f5985627e8f12b24d /sys/xen
parentab639f2398bf7efd4dfd38cd6527e22f6e781ae9 (diff)
Create wrapper for Giant taken for newbus
Create a wrapper for newbus to take giant and for busses to take it too. bus_topo_lock() should be called before interacting with newbus routines and unlocked with bus_topo_unlock(). If you need the topology lock for some reason, bus_topo_mtx() will provide that. Sponsored by: Netflix Reviewed by: mav Differential Revision: https://reviews.freebsd.org/D31831
Diffstat (limited to 'sys/xen')
-rw-r--r--sys/xen/xenbus/xenbusb.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/sys/xen/xenbus/xenbusb.c b/sys/xen/xenbus/xenbusb.c
index 74e095f6cda2..09b59a64ab4e 100644
--- a/sys/xen/xenbus/xenbusb.c
+++ b/sys/xen/xenbus/xenbusb.c
@@ -533,12 +533,9 @@ xenbusb_probe_children_cb(void *arg, int pending __unused)
{
device_t dev = (device_t)arg;
- /*
- * Hold Giant until the Giant free newbus changes are committed.
- */
- mtx_lock(&Giant);
+ bus_topo_lock();
xenbusb_probe_children(dev);
- mtx_unlock(&Giant);
+ bus_topo_unlock();
}
/**