From nobody Fri Mar 6 21:32:43 2026 X-Original-To: dev-commits-src-all@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 4fSKPl3Wz2z6TVRS for ; Fri, 06 Mar 2026 21:32:43 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fSKPl15Dfz3jl2 for ; Fri, 06 Mar 2026 21:32:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1772832763; 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=rD12VLLzezxRvwzjzWpVykHEJ+RSOotGgJyoqQTRpig=; b=LbESwLhHxS6SeLrutWzDKthkDmQUmW1uF7xKNwGDZEn8wsUVxLefVtgCC7D4dU2/77wp8D i0MGR0B/Q2CxOlDKXCWTeAYW4h4tzUzMPXjHA3cZ9vHIwhR8a8cRm2y3sKHNaz8dENRErh du6jNWIOZfn7BcSTWigBxKyVSgV/PEGHvWnPYyyo4L0yACPkm7t0Uf3kTDbETzrcP6xohT o7MAw+Opqy7e1oJJQd7fYyG6Kp5jiGesaWOS8AfkFL7rqb01hgT6Os/+qXstMaMJFc+5Ap ly0Xl1eXIng5DwSKMiuJtyMlhg7ASRlhliZlBX+dQXRvBnrij+FAPaMmPHcdmw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1772832763; a=rsa-sha256; cv=none; b=qjhqsTwL/9lofyHKTtxNpep+RPT0k9lbfbfhstQDjPk4anaw7+Z16IaMGjKvhR7uxNovZM K4vfDXiEyJ1hKts8+WS4m3da+eZh7ICPmbtd1hJuITURyGk9YbeQ5zJgGrLUHF8i27+6Um uTD9LZl/DODnC5QI53Y7iIr/1eYfkubI14r4g3t2T2k1iwwD39wIZlrEEsYbA37jlSpdYh hF0RtFFKWLhw0dg+470amGFyXPdYb8/+eMcZysUWkkLwbwCTOLJ8HAT4ChoTNFqKPxk/fs 5xNSNjN4JA0RFUmzYMumUiJP+R9OupMXt5lL88UclO+5wuPFb3EUMoEdZIhzjA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1772832763; 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=rD12VLLzezxRvwzjzWpVykHEJ+RSOotGgJyoqQTRpig=; b=O0Z0QARsGUUZr0Ehx3g07GyxsUJqDTO9fKRZpDihLlQAZR9LbeJYqupeKOGxjm0dxUdoXL eJeNbmqdHUvzu3m3nU1uDrobxBKHyMX0RwhpyLf0BmbpY4Z3hAEDF2jZgDa4IQKCUXcMYi nlPBVbG6T2am2V9AozF5ATfakdR+uFpl6g1MFW7VwDMRoTjaVntcLqjOXhd9a7QiLIGAVd jEQCDXq2g/dPvE/OaGoAUAbhxxmQGde3KmlsgcjimokAPeF8FdjqpU+g78UlkE78OQfUaU YNp/k6ahiamk0ZVxxwF37I1FO/8fj0braT5DIevTD0mh1ihoGvD5lpVTjw5FlA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fSKPl0gQMzgT8 for ; Fri, 06 Mar 2026 21:32:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3aafa by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 06 Mar 2026 21:32:43 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 1e4086d05297 - main - sys: Don't pass RF_ALLOCATED to bus_alloc_resource* List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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: 1e4086d05297b711081fe06933677925c5ee6232 Auto-Submitted: auto-generated Date: Fri, 06 Mar 2026 21:32:43 +0000 Message-Id: <69ab47fb.3aafa.383d36be@gitrepo.freebsd.org> The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=1e4086d05297b711081fe06933677925c5ee6232 commit 1e4086d05297b711081fe06933677925c5ee6232 Author: John Baldwin AuthorDate: 2026-03-06 21:32:33 +0000 Commit: John Baldwin CommitDate: 2026-03-06 21:32:33 +0000 sys: Don't pass RF_ALLOCATED to bus_alloc_resource* This is a nop as eventually these flags are passed to rman_reserve_resource which unconditionally sets RF_ALLOCATED in the new flags for a region. However, it's really a layering violation to use RF_ALLOCATED in relation to struct resource objects outside of subr_rman.c as subr_rman.c uses this flag to manage it's internal tracking of allocated vs free regions. In addition, don't document this as a valid flag in the manual. I think the intention here was that if a caller didn't want to pass RF_ACTIVE or RF_SHAREABLE, they could pass RF_ALLOCATED instead of 0, but given the layering violation, I think it's best to just pass 0 instead in that case. NB: The bhnd bus uses RF_ALLOCATED (along with RF_ACTIVE) in a separate API to manage resource regions that are not struct resource objects (but a separate wrapper object). It would perhaps be cleaner if the chipc_retain_region and chipc_release_region functions used their own flag constants instead of reusing the rman(9) flags. Reviewed by: imp, kib Differential Revision: https://reviews.freebsd.org/D55683 --- share/man/man9/bus_alloc_resource.9 | 10 +++------- sys/arm/nvidia/tegra_pcie.c | 5 ++--- sys/x86/iommu/amd_drv.c | 2 +- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/share/man/man9/bus_alloc_resource.9 b/share/man/man9/bus_alloc_resource.9 index 210abb3074e1..d69917d17ffd 100644 --- a/share/man/man9/bus_alloc_resource.9 +++ b/share/man/man9/bus_alloc_resource.9 @@ -26,7 +26,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd October 30, 2025 +.Dd March 6, 2026 .Dt BUS_ALLOC_RESOURCE 9 .Os .Sh NAME @@ -142,12 +142,8 @@ is used, if it is bigger than the default value. .It .Fa flags sets the flags for the resource. -You can set one or more of these flags: -.Bl -tag -width RF_SHAREABLE -.It Dv RF_ALLOCATED -resource has been reserved. -The resource still needs to be activated with -.Xr bus_activate_resource 9 . +You can set zero or more of these flags: +.Bl -tag -width RF_PREFETCHABLE .It Dv RF_ACTIVE activate resource atomically. .It Dv RF_PREFETCHABLE diff --git a/sys/arm/nvidia/tegra_pcie.c b/sys/arm/nvidia/tegra_pcie.c index ec272523df1b..c7a30965a5e5 100644 --- a/sys/arm/nvidia/tegra_pcie.c +++ b/sys/arm/nvidia/tegra_pcie.c @@ -1468,7 +1468,7 @@ tegra_pcib_attach(device_t dev) } /* * XXX - FIXME - * tag for config space is not filled when RF_ALLOCATED flag is used. + * tag for config space is not filled when RF_ACTIVE flag is not used. */ sc->bus_tag = rman_get_bustag(sc->pads_mem_res); @@ -1482,8 +1482,7 @@ tegra_pcib_attach(device_t dev) } rid = 2; - sc->cfg_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, - RF_ALLOCATED); + sc->cfg_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, 0); if (sc->cfg_mem_res == NULL) { device_printf(dev, "Cannot allocate config space memory\n"); rv = ENXIO; diff --git a/sys/x86/iommu/amd_drv.c b/sys/x86/iommu/amd_drv.c index bf7ac4b157c4..3a7b2819cbdd 100644 --- a/sys/x86/iommu/amd_drv.c +++ b/sys/x86/iommu/amd_drv.c @@ -494,7 +494,7 @@ amdiommu_attach(device_t dev) } sc->mmio_res = bus_alloc_resource(dev, SYS_RES_MEMORY, &sc->mmio_rid, sc->mmio_base, sc->mmio_base + sc->mmio_sz - 1, sc->mmio_sz, - RF_ALLOCATED | RF_ACTIVE | RF_SHAREABLE); + RF_ACTIVE | RF_SHAREABLE); if (sc->mmio_res == NULL) { device_printf(dev, "bus_alloc_resource %#jx-%#jx failed\n",