From nobody Tue Dec 9 22:45:30 2025 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 4dQv85064kz6Jxc6; Tue, 09 Dec 2025 22:45:41 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 "smtp.freebsd.org", Issuer "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dQv844nd4z4MPL; Tue, 09 Dec 2025 22:45:40 +0000 (UTC) (envelope-from bz@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765320340; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=s5o88g1DnMrSQ8i5FI1JjYjxZ80MGwM95c8iI4q15zU=; b=qtuI1w7x3rttRe3AuTlNDWmXVwBEf8OUigOdnUf6iIIuDfqcMc0Qz1gdlsmxiMlILDgVrR Vw6r70Xfn5/TZ9VlWdnW2OekfyCeWXosOGzCudZLUJE1T2mpJ+Q36Q04hatEYAoRn8maid wufEplSCquD0FVC1W6DtAX61HanJuewfltIKOq7pSKmQfzkb7Q1+jb2D7pqkpPGVAayff2 ywZBQLHF4akfXJ/oT6JlGKytETP2uwi6Uxl4V/klpGEu5bK+Q1aaDgplXgUkIbefcSwiPo BB+C5QLUnUw0l4ySRm5PSAb9DZYhxEUWz9dFZMWJu8kEqNq+AA5n0rotbFhwZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765320340; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=s5o88g1DnMrSQ8i5FI1JjYjxZ80MGwM95c8iI4q15zU=; b=tuwG7skmvMm10yuCs3v7qDP9EFKjOTAhQ/RlDtmVfsky3lxdsNPGzSJNvz49VXN8H8qfzZ ZabKtSrYAvPPI18y1RlZtdIgYkUUQPF1YZNVc/irjou9G2JXSwclA4DGBPzkoCu9K2HhyJ /nXcauZRzDTEVF2rVsezmJK2IVtlIX+BfKH+EDw6ldUXcjycj1ECCtE6RmoehNOFqArqgu wZSXLd507mCo2mnKF0Vf1bmveyO3X1avoHZEB81aTCj5jWakWJlzAN+8O/ua75A69t7azH gbMdDz3VvmUQ9DtUVuJWUuTR22LBCc4tJjTptwUaXD2HQPyOeZT+9IKA7XXiRA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765320340; a=rsa-sha256; cv=none; b=x3tgupkIlXceX8jRkPgMIt6NkK2xDlk0pw289XcYtKRLN6JHuC/0i9g6z5/iMoW6Mtp0Up rynGRbR/zWGSspru/8J3mr002kqafGJgEaAN9GwNDsEeVARa6ry4OB1osvTkzXJNVeVxH0 Pbd5wG+fLwGbLxUJbF9WBlSWUL993Ea12JpWevyzBcFMDrlZpvydl1xzOeuqVI/Jze7xl8 xYWLoKcsF3w21epCSvQHX6b4UwA9fX0ZocnEKT2Qg8Anzb6IEtBrkFq40O2pJ6KZO4BFPs g7zVqDlpbcIt2q8ZPZffORZAZscmh1IC3eOCC1LldSRMHfPfMaDaGZNh9MRhkw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from mx-01.divo.sbone.de (mx-01.divo.sbone.de [IPv6:2003:a:140a:2200:6:594:fffe:19]) (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 ECDSA (prime256v1) client-digest SHA256) (Client CN "mx-01.divo.sbone.de", Issuer "E8" (verified OK)) (Authenticated sender: bz/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4dQv843FkhzqNP; Tue, 09 Dec 2025 22:45:40 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:1025]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by mx-01.divo.sbone.de (Postfix) with ESMTPS id 6D554A64805; Tue, 09 Dec 2025 22:45:19 +0000 (UTC) Received: from content-filter.t4-02.sbone.de (content-filter.t4-02.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:2742]) (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) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 3EA8F2D029E6; Tue, 9 Dec 2025 22:45:33 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:4902:0:7404:2:1025]) by content-filter.t4-02.sbone.de (content-filter.t4-02.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:2742]) (amavisd-new, port 10024) with ESMTP id lIVSwWwMRkBL; Tue, 9 Dec 2025 22:45:31 +0000 (UTC) Received: from nv.t4-02.sbone.de (nv.t4-02.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:22]) (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) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id B44612D029D8; Tue, 9 Dec 2025 22:45:31 +0000 (UTC) Date: Tue, 9 Dec 2025 22:45:30 +0000 (UTC) From: "Bjoern A. Zeeb" To: John Baldwin cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 575639548cef - main - bus_alloc_resource: Pass rid by value to BUS_ALLOC_RESOURCE DEVMETHOD In-Reply-To: <2f83e5f9-74f0-4cc5-aebd-a89be8ed4464@FreeBSD.org> Message-ID: References: <693882af.2fecd.1848e0d9@gitrepo.freebsd.org> <2f83e5f9-74f0-4cc5-aebd-a89be8ed4464@FreeBSD.org> X-OpenPGP-Key-Id: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 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=US-ASCII; format=flowed On Tue, 9 Dec 2025, John Baldwin wrote: Hi, upfront: while talking about this very specific change as well, I really just want to point out the general problem. > On 12/9/25 15:12, John Baldwin wrote: >> The branch main has been updated by jhb: >> >> URL: >> https://cgit.FreeBSD.org/src/commit/?id=575639548cef58590a1d70c29e47aae0e8d44153 >> >> commit 575639548cef58590a1d70c29e47aae0e8d44153 >> Author: John Baldwin >> AuthorDate: 2025-12-09 19:59:21 +0000 >> Commit: John Baldwin >> CommitDate: 2025-12-09 20:00:06 +0000 >> >> bus_alloc_resource: Pass rid by value to BUS_ALLOC_RESOURCE DEVMETHOD >> The wrapper functions such as bus_alloc_resource_any() still >> support >> passing the rid by value or pointer, but the underlying implementation >> now passes by value. >> Reviewed by: imp >> Differential Revision: https://reviews.freebsd.org/D53402 > > FYI, this breaks the build of drm-kmod (hence the __FreeBSD_version bump). > I will open a PR against drm-kmod shortly, but it will still take some time > for the patch to make its way into ports. There's not really a great way > to stage changes that depend on __FreeBSD_version bumps. :( Yes, it is a pain. The version check needs to go in for multiple different branches but likely also needs to be applied to ports via patch file as at least one is based on a tag and not on a branch currently for as much as I remember. Just saying as I ran into all the tiny details with my previous PCI cleanup there, which cost me a delay of more than 2 months to get things in (and then still broke nvidia graphics and networking). Even if not a graphics person, I'll be happy to review this. That said, I believe, what I had said before, the proper solution [for this specific case] would have been to implement pci_bus_alloc_resource() in LinuxKPI and get rid of the FreeBSD specific native code. We already have "drmn" specific workaorunds in LinuxKPI due to the special bit of "vgapci" sitting in front of it. The infrastructure for that is sadly there but at least it is in one place under one name. We would have had to ship that implementation with drm-kmod for older releases but the problem would have been sorted, and could have been sorted upfront. We get bitten by unneccesary native code in drm-kmod (and elsewhere) a lot more these days and every opportunity to clean on up not taken will just bring more pain later. I have the next of these "native code in Linux code" problems queued already for amdgpu but also some in-tree consumers have similar issues (sometimes the other way round being mostly native but still using some LinuxKPI headers). /bz -- Bjoern A. Zeeb r15:7