From nobody Fri Apr 24 17:56:15 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 4g2LHM6fGzz6ZxR9 for ; Fri, 24 Apr 2026 17:56:15 +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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4g2LHM4YJwz3qPq for ; Fri, 24 Apr 2026 17:56:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1777053375; 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=2ZrfB+EZRNimGDYbzZX73kM0tPMylnH+xoEU+k/i+m0=; b=MdfWhMSNQCw+vslKRXMF2VUqqp/hYtF45WeyLNcwvpXCmGL1E1qgUhUmSqQIikl+BntKEX sLGKE7BR2qK8skhcJ4x72DX11qOfnOwPvGjtjPL2+zZYd/Sfmg1Z1w6pxViOhfMOcPrJ0G jV+gdyTawA3yHtNTrMJa0tjNX4kRiQjQL+4ZHMoDYrv4fK9LiklsUrnq3GuUALoAZoH4pd WGVnD+IZRVH6z0S+s1ZaMeoeVJykME9CHpjIOlUlcjFweobeuPGjaHOTEwThqbFkAEg+eK 8oH/nS8zZmiJIQPhitn9X3fZOGQm6ejNMD07mfqdSkEDVN/gMKv+9gQB/LIkLQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1777053375; a=rsa-sha256; cv=none; b=svyzRaEmlUvCM3IyIG4UNEfdGqqayPA1Tq93GM5ekn6K/nNpTcVKjXDw94dWmM1+fE5bwk QBB1EDB/f9rJp0F9LdIS62ZvRQTx5Ks/lN1cVkK297cha9MimHsYABSGUSnXc9sz1jyLfi Ur7tlnjp+vW2knQEufb/3stXkVz/ognjip9pkl6MDozOeSRL3mkUCZ9mag2jZkWtckjnJW NY6QuKATYdLmhRMkxAlB3SSk3W9j6kyDKALS/aI8MMmnunvl21g8PTgvOCiXB5c1/HSp1/ mYaFDbGFZa+d2vW3ivOykgtna7A7MZMw+7p26k86UIiJ3tWW7+MuJ6v2Y9SRKw== 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=1777053375; 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=2ZrfB+EZRNimGDYbzZX73kM0tPMylnH+xoEU+k/i+m0=; b=Wgw+W228rKHGtTNPD2Wj7TyZBe5qMnFHkhpJxjrht4NxCx0EqtYHA6peROY9Cnb3TOzFQ3 v2ZfIZn+gftF6oTE7CPlZzhg/H9yvWHveF65tBdauaAZSe0uc4FJnxYUePwqUisqt2auE5 nlrGxpvSpoxvgo7Pjj2Iy8lPmfUBhVMhsx+S61305D01JpkpJwtgneHr4cRJvVgm+YXP/M 50Sw8wwo+8J+4qjMA3iqpFULurzxzyEDVT3g9I5kA7HVUvPFANgPsI9RACZlBg0rYovSgA M8xQK1C4Ac2IvoVkJy/6apuy3HepwmLfkPODnKAJUB/Y0gi+aL5sSOQAXdH+kg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4g2LHM44Zcz1Cb2 for ; Fri, 24 Apr 2026 17:56:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1dca1 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 24 Apr 2026 17:56:15 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 7f4940dd226c - stable/15 - 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/stable/15 X-Git-Reftype: branch X-Git-Commit: 7f4940dd226c56db7758e8c234ac0dacb2867325 Auto-Submitted: auto-generated Date: Fri, 24 Apr 2026 17:56:15 +0000 Message-Id: <69ebaebf.1dca1.580135ac@gitrepo.freebsd.org> The branch stable/15 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=7f4940dd226c56db7758e8c234ac0dacb2867325 commit 7f4940dd226c56db7758e8c234ac0dacb2867325 Author: John Baldwin AuthorDate: 2026-03-06 21:32:33 +0000 Commit: John Baldwin CommitDate: 2026-04-24 17:33:52 +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 (cherry picked from commit 1e4086d05297b711081fe06933677925c5ee6232) --- 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",