git: 5e203517e0d2 - main - usb(4): Use the global BUS topology lock where appropriate.
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 17 Mar 2022 14:29:56 UTC
The branch main has been updated by hselasky:
URL: https://cgit.FreeBSD.org/src/commit/?id=5e203517e0d231e7edfa86bac5d577137896ce45
commit 5e203517e0d231e7edfa86bac5d577137896ce45
Author: Hans Petter Selasky <hselasky@FreeBSD.org>
AuthorDate: 2022-03-17 14:20:51 +0000
Commit: Hans Petter Selasky <hselasky@FreeBSD.org>
CommitDate: 2022-03-17 14:27:45 +0000
usb(4): Use the global BUS topology lock where appropriate.
MFC after: 1 week
Sponsored by: NVIDIA Networking
---
sys/dev/usb/usb_hub.c | 12 ++++++------
sys/dev/usb/usb_hub_acpi.c | 4 ++--
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/sys/dev/usb/usb_hub.c b/sys/dev/usb/usb_hub.c
index 77e519126567..6cd4cfd37ee4 100644
--- a/sys/dev/usb/usb_hub.c
+++ b/sys/dev/usb/usb_hub.c
@@ -1647,7 +1647,7 @@ uhub_child_location(device_t parent, device_t child, struct sbuf *sb)
sc = device_get_softc(parent);
hub = sc->sc_udev->hub;
- mtx_lock(&Giant);
+ bus_topo_lock();
uhub_find_iface_index(hub, child, &res);
if (!res.udev) {
DPRINTF("device not on hub\n");
@@ -1667,7 +1667,7 @@ uhub_child_location(device_t parent, device_t child, struct sbuf *sb)
#endif
);
done:
- mtx_unlock(&Giant);
+ bus_topo_unlock();
return (0);
}
@@ -1687,7 +1687,7 @@ uhub_get_device_path(device_t bus, device_t child, const char *locator,
sc = device_get_softc(bus);
hub = sc->sc_udev->hub;
- mtx_lock(&Giant);
+ bus_topo_lock();
uhub_find_iface_index(hub, child, &res);
if (!res.udev) {
printf("device not on hub\n");
@@ -1695,7 +1695,7 @@ uhub_get_device_path(device_t bus, device_t child, const char *locator,
}
sbuf_printf(sb, "/USB(0x%x,0x%x)", res.portno - 1, res.iface_index);
done:
- mtx_unlock(&Giant);
+ bus_topo_unlock();
return (0);
}
@@ -1718,7 +1718,7 @@ uhub_child_pnpinfo(device_t parent, device_t child, struct sbuf*sb)
sc = device_get_softc(parent);
hub = sc->sc_udev->hub;
- mtx_lock(&Giant);
+ bus_topo_lock();
uhub_find_iface_index(hub, child, &res);
if (!res.udev) {
DPRINTF("device not on hub\n");
@@ -1755,7 +1755,7 @@ uhub_child_pnpinfo(device_t parent, device_t child, struct sbuf*sb)
usbd_ctrl_unlock(res.udev);
}
done:
- mtx_unlock(&Giant);
+ bus_topo_unlock();
return (0);
}
diff --git a/sys/dev/usb/usb_hub_acpi.c b/sys/dev/usb/usb_hub_acpi.c
index ec5a457cb810..5a4e73005400 100644
--- a/sys/dev/usb/usb_hub_acpi.c
+++ b/sys/dev/usb/usb_hub_acpi.c
@@ -526,9 +526,9 @@ acpi_uhub_read_ivar(device_t dev, device_t child, int idx, uintptr_t *res)
struct acpi_uhub_softc *sc = device_get_softc(dev);
ACPI_HANDLE ah;
- mtx_lock(&Giant);
+ bus_topo_lock();
uhub_find_iface_index(sc->usc.sc_udev->hub, child, &hres);
- mtx_unlock(&Giant);
+ bus_topo_unlock();
if ((idx == ACPI_IVAR_HANDLE) &&
(hres.portno > 0) &&