Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F115073432
D31840.id94678.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D31840.id94678.diff
View Options
Index: sys/dev/hyperv/vmbus/vmbus.c
===================================================================
--- sys/dev/hyperv/vmbus/vmbus.c
+++ sys/dev/hyperv/vmbus/vmbus.c
@@ -520,9 +520,9 @@
{
struct vmbus_softc *sc = xsc;
- mtx_lock(&Giant);
+ bus_topo_lock();
sc->vmbus_scandone = true;
- mtx_unlock(&Giant);
+ bus_topo_unlock();
wakeup(&sc->vmbus_scandone);
}
@@ -577,9 +577,9 @@
* Wait for all vmbus devices from the initial channel offers to be
* attached.
*/
- GIANT_REQUIRED;
+ bus_topo_assert();
while (!sc->vmbus_scandone)
- mtx_sleep(&sc->vmbus_scandone, &Giant, 0, "vmbusdev", 0);
+ mtx_sleep(&sc->vmbus_scandone, bus_topo_mtx(), 0, "vmbusdev", 0);
if (bootverbose) {
device_printf(sc->vmbus_dev, "device scan, probe and attach "
@@ -592,17 +592,17 @@
vmbus_scan_teardown(struct vmbus_softc *sc)
{
- GIANT_REQUIRED;
+ bus_topo_assert();
if (sc->vmbus_devtq != NULL) {
- mtx_unlock(&Giant);
+ bus_topo_unlock();
taskqueue_free(sc->vmbus_devtq);
- mtx_lock(&Giant);
+ bus_topo_lock();
sc->vmbus_devtq = NULL;
}
if (sc->vmbus_subchtq != NULL) {
- mtx_unlock(&Giant);
+ bus_topo_unlock();
taskqueue_free(sc->vmbus_subchtq);
- mtx_lock(&Giant);
+ bus_topo_lock();
sc->vmbus_subchtq = NULL;
}
}
@@ -1070,19 +1070,18 @@
struct vmbus_softc *sc = chan->ch_vmbus;
device_t parent = sc->vmbus_dev;
- mtx_lock(&Giant);
-
+ bus_topo_lock();
chan->ch_dev = device_add_child(parent, NULL, -1);
if (chan->ch_dev == NULL) {
- mtx_unlock(&Giant);
+ bus_topo_unlock();
device_printf(parent, "device_add_child for chan%u failed\n",
chan->ch_id);
return (ENXIO);
}
device_set_ivars(chan->ch_dev, chan);
device_probe_and_attach(chan->ch_dev);
+ bus_topo_unlock();
- mtx_unlock(&Giant);
return (0);
}
@@ -1091,13 +1090,13 @@
{
int error = 0;
- mtx_lock(&Giant);
+ bus_topo_lock();
if (chan->ch_dev != NULL) {
error = device_delete_child(chan->ch_vmbus->vmbus_dev,
chan->ch_dev);
chan->ch_dev = NULL;
}
- mtx_unlock(&Giant);
+ bus_topo_unlock();
return (error);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Apr 21, 5:23 AM (18 h, 19 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
17662587
Default Alt Text
D31840.id94678.diff (2 KB)
Attached To
Mode
D31840: hyperv: scanning locking is using the bus mtx
Attached
Detach File
Event Timeline
Log In to Comment