From nobody Thu Mar 17 14:29:56 2022 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 1D8321A1D365; Thu, 17 Mar 2022 14:29:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4KK8g83DXbz3HHg; Thu, 17 Mar 2022 14:29:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1647527396; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FiX4xdE5N23VnDVO9l4ngeeYDiWKFA/tOqqg++MoY7Q=; b=ouEF4B0rEkBP+UoCeHPGy9CNbsP86qgcXqJ2+8Y7A3S0K1hZaDRvOi/DhlVz7ZWcVDuvHj g+BhVGfRzFSSlX2M6SIgCLYAoTjPtKdhP/kq/ue7J4D1VOJR28UjIrSt1+V/1+Cjlo2qc2 XnpxOjp7qYtcgGDkv/1xeege1MDJV9nLiXnuGM7YI/8n9Qa/yNkedeVz+su4jqCP9WgpFp Gdal5DiVZjjeO4k3i2poipKI4gCeiQQfI6X6tDUQezFzPcWgwH+HLObyRFaQ2V7YklRSxC cbi4N1bt0DvgTD+qtRfr4NNoDdvpyZ1OPBgjnrtBx272si4PpXbd3Qaw05sPFw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 33C8040E9; Thu, 17 Mar 2022 14:29:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 22HETuX8044786; Thu, 17 Mar 2022 14:29:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 22HETum0044785; Thu, 17 Mar 2022 14:29:56 GMT (envelope-from git) Date: Thu, 17 Mar 2022 14:29:56 GMT Message-Id: <202203171429.22HETum0044785@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Hans Petter Selasky Subject: git: 5e203517e0d2 - main - usb(4): Use the global BUS topology lock where appropriate. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5e203517e0d231e7edfa86bac5d577137896ce45 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1647527396; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FiX4xdE5N23VnDVO9l4ngeeYDiWKFA/tOqqg++MoY7Q=; b=mPQJf9UbV8gXEFmg/FiZhMCrb1vl1x/jK2b7xOP9dTmXb0DGR2qDpLDnPZ5c951VtfS6DJ 24hvExwPa4y4TGvJRB9V+hMRET5fl6OFrhSvW33KHgIRrhlesEBLqwgZUnJz8jzMhosOOI futQlEaEJfM6fZFV78afe6TgSxe38nmJnYLiJW3Ckwb+6yw4ROLcS2dnTxO9A16LBLoHH8 hvp8dPwRXw5WnJM4J1QsoDJG62OKOOQgAKOPcGLKyA3iBc8GCNePWa71H/pVCD9CdLH+gZ cPVjDWMiF4o4+4q/jS8xDJpg/ywi/M3uUwHVRP9EB6yZsP42DHAoK5I2guuGVg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1647527396; a=rsa-sha256; cv=none; b=RLxFDTXic82BOWxUbfZyQ3UfvMgNo7VaS8fgfngSdwuDdNM24Xe4Yoi/IVc0B0RcQi4AYB 0qqoxbhr2BDjNLvHcw82bqrwTkeWv31XxqHN1sX4xYEJRMeTkxAJhHxHBxnz47XCR9grwD Ektc7jU309zQ/ZvMCwKHbaEzDKflF5xzc4dMfTFCCqihFLoTMBm91aJ9ra79e+q7p1TcVx upZlfPljfnRrbRu02z9QxWRDxRZL1FJCyGVCAOoRJeo31aTns1eUH+rQNV72CJ1QI1RIuh ErdyJINS3isW30ApQCKuYs3KZrOvwLDN84lO6fqmFNNOflbTibc9z3BMQSyIPA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=5e203517e0d231e7edfa86bac5d577137896ce45 commit 5e203517e0d231e7edfa86bac5d577137896ce45 Author: Hans Petter Selasky AuthorDate: 2022-03-17 14:20:51 +0000 Commit: Hans Petter Selasky 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) &&