From nobody Thu Jan 02 18:28:16 2025 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 4YPFZS5bc7z5jnRN; Thu, 02 Jan 2025 18:28:16 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YPFZS4vhYz4tsP; Thu, 2 Jan 2025 18:28:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1735842496; 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=s7+ZPLJyWdC5WBt618vqxL/+0B/WQCq8ULutSDDIpCg=; b=aFryGVEB/E7328EtdrylNe+/942zg6zKLxyBGAzg0TgDmqw+SKka/l+qSvhAIMMfDnCt8s YnhM6Kt5D3moI2XdRBrQYJp6jzKgCnCCo6hUx0V33aa3MVShq01e4vlYa6eF/Kbq8wCVGd 8q/l8ItP5SyfI7+tlzd8Tgeewkjuu03R00a2LTlS82DzDT6gtDnpgy/Ow9NUBJggeBU0KW /T1XSMt77Lb8FsP6WpXjDTCOgE3xocVgE7zjeheRe9NciA8Z9xNiPGjK1+Oa1xwQEwYNM3 PdQHzw8+3HYi+C09rgGKvgQvmmJgGZC4/Dk8XqSi+5rj6t9ekTJkQSH1cxEdzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1735842496; 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=s7+ZPLJyWdC5WBt618vqxL/+0B/WQCq8ULutSDDIpCg=; b=eFivIaKnn3+fVCURFS8+uPnUdY2JF0ymjzdMB2v712nhq4pQVHa3sDliCItBaBirchF8b/ L65Xk1TIomEcEPenbxKdLY6Ow523I8MVzoy5zmzRbmm9SH/1YIKu/mVIhPApLxxKyMoPiI /Dkz0xQtC8yZxqXewmqNWBb1f4BaTQif8mCUicVomevi2DAcQb+ebPBTWF9QcgyuCHFA6B Ckq6669Q0IDt1GOBRC/kR5QCEH6vTq9Ynm9AezFY9nqY+7E96Ml6pPV2Pv8UHqGc4bHVXZ iSzT+m19XDzS/Wz1gxrjAa2jtajGoCy07aSP8gAUExeN4tTH7PEygF6LnJKH1g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1735842496; a=rsa-sha256; cv=none; b=m3trlanf9qs+FBZj8X1j2xelReP95X+1ABUzDj41enqNwxYBV/U+DANDMAHcZ+EjJVuslC j0TxnK6i5P8OXI0AnpF/gF7M0iCZj7tYuWdISrNRON37C7fy5h/YoLzVythnQmv7HL/qNV BmAj/6SKlePp34Hc4F0Eok7NFaOYJLlokqoYWQk7qHfgb1f4wzzw39qVTKnGOyrw3zTigB R8pczqBMhuNK0VlyYbqZdDAEpQO8GXe4YFimnJ8PjOSHlC1HQKjeNweSDPkSlRFboHt5/p GicDMRw7hmDz3SEGTu/gH+9C/IknYnBTIZ/IKhEDcIhLQHQ90w6VrCiywBjjZw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4YPFZS4TGnzpJk; Thu, 02 Jan 2025 18:28:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 502ISGgX065987; Thu, 2 Jan 2025 18:28:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 502ISGJ3065984; Thu, 2 Jan 2025 18:28:16 GMT (envelope-from git) Date: Thu, 2 Jan 2025 18:28:16 GMT Message-Id: <202501021828.502ISGJ3065984@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: e9d3857040a1 - main - Use bus_detach_children instead of bus_generic_detach 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e9d3857040a1983f6cf8780783da4da34773f660 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=e9d3857040a1983f6cf8780783da4da34773f660 commit e9d3857040a1983f6cf8780783da4da34773f660 Author: John Baldwin AuthorDate: 2025-01-02 18:19:39 +0000 Commit: John Baldwin CommitDate: 2025-01-02 18:19:39 +0000 Use bus_detach_children instead of bus_generic_detach These drivers perform additional teardown steps in between detaching child devices and deleting child devices. Differential Revision: https://reviews.freebsd.org/D47957 --- sys/arm/nvidia/tegra_sdhci.c | 2 +- sys/dev/cxgb/cxgb_main.c | 4 ++-- sys/dev/cxgbe/t4_main.c | 2 +- sys/dev/gpio/gpiobus.c | 2 +- sys/dev/gpio/gpioiic.c | 2 +- sys/dev/pci/pci_pci.c | 2 +- sys/dev/sdhci/sdhci_fdt.c | 2 +- sys/dev/sdhci/sdhci_xenon.c | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/sys/arm/nvidia/tegra_sdhci.c b/sys/arm/nvidia/tegra_sdhci.c index 4d2eaccf4c27..3bd9a9bb4632 100644 --- a/sys/arm/nvidia/tegra_sdhci.c +++ b/sys/arm/nvidia/tegra_sdhci.c @@ -418,7 +418,7 @@ tegra_sdhci_detach(device_t dev) struct tegra_sdhci_softc *sc = device_get_softc(dev); struct sdhci_slot *slot = &sc->slot; - bus_generic_detach(dev); + bus_detach_children(dev); sdhci_fdt_gpio_teardown(sc->gpio); clk_release(sc->clk); bus_teardown_intr(dev, sc->irq_res, sc->intr_cookie); diff --git a/sys/dev/cxgb/cxgb_main.c b/sys/dev/cxgb/cxgb_main.c index ed0993f934f1..a19483c7cbbf 100644 --- a/sys/dev/cxgb/cxgb_main.c +++ b/sys/dev/cxgb/cxgb_main.c @@ -729,7 +729,7 @@ cxgb_free(struct adapter *sc) /* * Make sure all child devices are gone. */ - bus_generic_detach(sc->dev); + bus_detach_children(sc->dev); for (i = 0; i < (sc)->params.nports; i++) { if (sc->portdev[i] && device_delete_child(sc->dev, sc->portdev[i]) != 0) @@ -1066,7 +1066,7 @@ cxgb_port_attach(device_t dev) /* * cxgb_port_detach() is called via the device_detach methods when - * cxgb_free() calls the bus_generic_detach. It is responsible for + * cxgb_free() calls the bus_detach_children. It is responsible for * removing the device from the view of the kernel, i.e. from all * interfaces lists etc. This routine is only called when the driver is * being unloaded, not when the link goes down. diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index 25d5dee8b781..755fd19a3c9c 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -1789,7 +1789,7 @@ t4_detach_common(device_t dev) } if (device_is_attached(dev)) { - rc = bus_generic_detach(dev); + rc = bus_detach_children(dev); if (rc) { device_printf(dev, "failed to detach child devices: %d\n", rc); diff --git a/sys/dev/gpio/gpiobus.c b/sys/dev/gpio/gpiobus.c index bc166f43d398..37371fa4e1cc 100644 --- a/sys/dev/gpio/gpiobus.c +++ b/sys/dev/gpio/gpiobus.c @@ -582,7 +582,7 @@ gpiobus_detach(device_t dev) ("gpiobus mutex not initialized")); GPIOBUS_LOCK_DESTROY(sc); - if ((err = bus_generic_detach(dev)) != 0) + if ((err = bus_detach_children(dev)) != 0) return (err); if ((err = device_delete_children(dev)) != 0) return (err); diff --git a/sys/dev/gpio/gpioiic.c b/sys/dev/gpio/gpioiic.c index 2404e70fc648..2197d238cf2b 100644 --- a/sys/dev/gpio/gpioiic.c +++ b/sys/dev/gpio/gpioiic.c @@ -331,7 +331,7 @@ gpioiic_detach(device_t dev) struct gpioiic_softc *sc = device_get_softc(dev); int err; - if ((err = bus_generic_detach(dev)) != 0) + if ((err = bus_detach_children(dev)) != 0) return (err); gpioiic_cleanup(sc); diff --git a/sys/dev/pci/pci_pci.c b/sys/dev/pci/pci_pci.c index c4f7814dfee5..44cbf327868c 100644 --- a/sys/dev/pci/pci_pci.c +++ b/sys/dev/pci/pci_pci.c @@ -1552,7 +1552,7 @@ pcib_detach(device_t dev) int error; sc = device_get_softc(dev); - error = bus_generic_detach(dev); + error = bus_detach_children(dev); if (error) return (error); #ifdef PCI_HP diff --git a/sys/dev/sdhci/sdhci_fdt.c b/sys/dev/sdhci/sdhci_fdt.c index e7dda316539c..1d8013ee7088 100644 --- a/sys/dev/sdhci/sdhci_fdt.c +++ b/sys/dev/sdhci/sdhci_fdt.c @@ -666,7 +666,7 @@ sdhci_fdt_detach(device_t dev) struct sdhci_fdt_softc *sc = device_get_softc(dev); int i; - bus_generic_detach(dev); + bus_detach_children(dev); bus_teardown_intr(dev, sc->irq_res, sc->intrhand); bus_release_resource(dev, SYS_RES_IRQ, rman_get_rid(sc->irq_res), sc->irq_res); diff --git a/sys/dev/sdhci/sdhci_xenon.c b/sys/dev/sdhci/sdhci_xenon.c index 4a823b896ca8..098412a81148 100644 --- a/sys/dev/sdhci/sdhci_xenon.c +++ b/sys/dev/sdhci/sdhci_xenon.c @@ -592,7 +592,7 @@ sdhci_xenon_detach(device_t dev) { struct sdhci_xenon_softc *sc = device_get_softc(dev); - bus_generic_detach(dev); + bus_detach_children(dev); bus_teardown_intr(dev, sc->irq_res, sc->intrhand); bus_release_resource(dev, SYS_RES_IRQ, rman_get_rid(sc->irq_res), sc->irq_res);