https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=290793
--- Comment #25 from [email protected] --- A commit in branch stable/14 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=c017775775ee7548a071806042b0294e94824991 commit c017775775ee7548a071806042b0294e94824991 Author: Bjoern A. Zeeb <[email protected]> AuthorDate: 2025-07-31 18:28:22 +0000 Commit: Bjoern A. Zeeb <[email protected]> CommitDate: 2026-01-16 19:37:47 +0000 LinuxKPI: pci: implement [linuxkpi_]pcim_request_all_regions() Factor out the pci_request_region() implementation into an internal function and make pci_request_region() a simple wrapperaround it. Likewise implement pcim_request_all_regions() as a loop calling pci_request_region() for each entry. In two cases which we returned an error before (bar index is valid but bar is not (no len), and neither IO nor MEM) we now reutrn success (nothing to do for us). Otherwise callers, especially pcim_request_all_regions() would error out for the wrong reasons. This seems to also match the expected behaviour of pci_request_region(). Sponsored by: The FreeBSD Foundation (intially) Reviewed by: dumbbell Differential Revision: https://reviews.freebsd.org/D52068 LinuxKPI: pci: undo the pci_resource_len() check in lkpi_pci_request_region() Creating non-passthru SR-IOV interfaces on a mlx5en(4) failed. The problem lies in the pci_resource_len() call but not that the BAR length is tmeporary 0 but in that we call lkpi_pci_get_bar() with a true argument which will create the BAR resource for us and report the approriate length back. However, the later call to bus_alloc_resource_any() will then fail given the resource already exists. Restore the previous behaviour and let bus_alloc_resource_any() do the work. Adjust the return values from -ENODEV to -EBUSY to match callers expectations. In linuxkpi_pcim_request_all_regions(), like in linuxkpi_pci_request_regions(), filter out the -EBUSY errors as "not an error" and try the next bar. This also seems to be consistent with the expectations of the callers. PR: 290793 Reported by: David BOYER (jcduss13 gmail.com) Tested on: mlx5en, iwlwifi, mt7921 Reviewed by: kib Fixes: 7e21158d44cd "implement [linuxkpi_]pcim_request_all_regions()" Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D53902 (cherry picked from commit 7e21158d44cd46e720395604ca6f00f2fa36b20c) (cherry picked from commit ff31767e530abb4a54131af199fed6ec946a5fa4) (cherry picked from commit ed29ffd396e522a45ab1980c12a75b3409b51712) (cherry picked from commit 2032abb31cbe067d41067a81e529d91f1bace4c9) sys/compat/linuxkpi/common/include/linux/pci.h | 11 ++++-- sys/compat/linuxkpi/common/src/linux_pci.c | 52 +++++++++++++++++++++----- 2 files changed, 51 insertions(+), 12 deletions(-) -- You are receiving this mail because: You are on the CC list for the bug.
