HomeFreeBSD

LinuxKPI: Support lazy BAR allocation

Description

LinuxKPI: Support lazy BAR allocation

Linux KPIs like pci_resource_start/len assume that BARs have been
allocated, but FreeBSD lazily allocates BARs if it cannot allocate the
firmware-allocated BARs. Thus using the Linux KPIs must force allocation
of the BARs rather than returning 0 for the start and length, which can
crash drm-kmod drivers that assume the BARs are valid. This is needed
for the AMDGPU driver to be able to attach on SiFive's HiFive Unmatched.

Reviewed by: hselasky, jhb, mav
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D32447

(cherry picked from commit 82098c8bb5b303c7c8b48e7537fadfe74b375bd3)

Details

Provenance
jrtc27Authored on Oct 17 2021, 2:32 PM
Reviewer
hselasky
Differential Revision
D32447: LinuxKPI: Support lazy BAR allocation
Parents
rGfeb3031f0ae8: LinuxKPI: Implement _ioremap_attr for riscv
Branches
Unknown
Tags
Unknown