From nobody Wed Dec 10 00:05:29 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 4dQwwB209Nz6K486; Wed, 10 Dec 2025 00:05:30 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 4dQwwB1R0Xz3HdG; Wed, 10 Dec 2025 00:05:30 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765325130; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pEk05nqtwb4JdTz6TjgUzdvSogY7TDb5H3Qiughtyb0=; b=cf0tpYjd2ggB2nunTP53BoH/j69b6DnwuC43wl7ISF1HKyl81bV7Zy9+JeNH35y5M49t3B IqKk1dXaUJdHyRuXmMYAXzM73HFVxjBox/0i+OEf/CbVP/KJQsARqSZ5a22eXbU1DBbYpB U9x3nFfPE3UYp/k10GkoXA8Z7trQ/TpyIgvJUl8RCnVRdUV3vRqj9vhbTbF9yTwtNVzU3I eTP+cspYw8IqDG7hfokW5H4hvYmwCzUGybbfE4xn9wtjfBgZtjp0rEglzlltrHoeZCX9+I hqrN3eT7zkfeLybMFFe7Y1bMxa9L5bSX2rqqJMXeWL4+xNy6RLSKUue2R9xGHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765325130; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pEk05nqtwb4JdTz6TjgUzdvSogY7TDb5H3Qiughtyb0=; b=OjEza0t6WQ5m3WnX1q6/71oddXmNjyuilS8Arj3fM3j5S8Qd4eWzJRcuYXOvXkZIOuOMlX dKg9+dsrIwdu0SPfdK3QZEMt9s8eeKanWOjsUpo6BtnyPtBrrjvmLRmX/TiqNGXsVgo/3S fKKeewI7ITC3kjhRVbK4eidmsgCIa7SAzjhiLHluGfLrYc9Hy06mMvAnruLceK/+sqjmu4 2MhCcbCkIlV+wG9gSmuHov/nsfG26Kq4KHlFvZlnTj4PGZDv1y68OTEwRU3i5UKE3pR4ev 93qoUoZZQOih7F/pl3bKBMAdtkN8OqI2ZcW1woyRyvmoPBZ0ZyJKQSqiK35ERQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765325130; a=rsa-sha256; cv=none; b=sqkRF24pxmppQ/7rqQTEbeJa3XEcUF5IraJAMFzUHw/pjNHxZSPvZQ2IVWHtKkPICCp7Du 8SMWeNpJF+B9ikAG1WXVF39j5Zr5Mxc3CeCO+wduh3dwdbP3F86taHah4w0mR7xHNt0i7w IU3QMn+TgPepKEmTLXHgPQEqXhJYgfM1/3e4hpwcvgLMj2csMscbPIfMESU4LNGtnmT3fB zgLhk/XK0plPkUAJzxJNEUTE5EjpiN1vQHFHN69dyQsYUnfcoJ8bDBzhWIbiIU5ykyj9J3 peUncesTuXvq+uz6tbNBn39q3cbwPjBF06HiudcOio3gEOgyr8KArFEEG3St6Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from [IPV6:2601:5c0:4202:5670:44e0:6039:a461:36a5] (unknown [IPv6:2601:5c0:4202:5670:44e0:6039:a461:36a5]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4dQww96XB0zs9g; Wed, 10 Dec 2025 00:05:29 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <8b52aeca-46cd-49b3-9a11-7c487fe62cb8@FreeBSD.org> Date: Tue, 9 Dec 2025 19:05:29 -0500 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 User-Agent: Mozilla Thunderbird Subject: Re: git: 575639548cef - main - bus_alloc_resource: Pass rid by value to BUS_ALLOC_RESOURCE DEVMETHOD Content-Language: en-US To: "Bjoern A. Zeeb" Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <693882af.2fecd.1848e0d9@gitrepo.freebsd.org> <2f83e5f9-74f0-4cc5-aebd-a89be8ed4464@FreeBSD.org> From: John Baldwin In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 12/9/25 17:45, Bjoern A. Zeeb wrote: > 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. Eh, even the Linux code is special in this case as it is allocating a non-standard BAR. We do support non-standard BARs (and don't require manually dinking with the register the way Linux does), and I have a patch to vga_pci to permit allocating those, but that needs a larger patch and more testing by someone with old enough hardware to test this case, and in general none of the drm-kmod folks ever replied on any of those reviews despite multiple pings, so I just went with the simpler approach. -- John Baldwin