Page MenuHomeFreeBSD

LinuxKPI: pci: undo the pci_resource_len() check in lkpi_pci_request_region()
AcceptedPublic

Authored by bz on Mon, Nov 24, 10:30 PM.

Details

Reviewers
kib
Group Reviewers
linuxkpi
Summary

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. Also restore the return value for pci_resource_type() to -ENODEV.

In linuxkpi_pcim_request_all_regions(), like in linuxkpi_pci_request_regions(),
filter out the -ENODEV errors as "not an error" and try the next bar.
It seems to be consistent with the expectations of the callers.

PR: 290793
Reported by: David BOYER (jcduss13 gmail.com)
Tested on: mlx5en, iwlwifi
Fixes: 7e21158d44cd "implement [linuxkpi_]pcim_request_all_regions()"
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 68833
Build 65716: arc lint + arc unit