Bug 241651

Summary: linuxkpi doesn't handle uninitialized PCI devices
Product: Base System Reporter: Justin Hibbits <jhibbits>
Component: kernAssignee: Mark Linimon <linimon>
Status: New ---    
Severity: Affects Only Me    
Priority: ---    
Version: CURRENT   
Hardware: Any   
OS: Any   

Description Justin Hibbits freebsd_committer freebsd_triage 2019-11-01 22:00:55 UTC
The linuxkpi assumes that PCI devices are already fully configured.  However, sometimes video cards are not configured by firmware and need to be initialized instead by FreeBSD.

Linux KPI uses the PCI device resource lists directly, which can fail when a device is not initialized.

According to jhb@, this should be done instead by using pci_find_bar(), and other PCI API functions, in linux_pci_get_bar() instead of trolling through the resource list directly, so that the BARs get properly initialized.
Comment 1 Justin Hibbits freebsd_committer freebsd_triage 2019-11-02 20:55:08 UTC
Happy to help where I can on my hardware, but hselasky knows the code best.
Comment 2 Hans Petter Selasky freebsd_committer freebsd_triage 2019-11-02 22:22:24 UTC
Is this relevant for i386 and amd64 or other platforms only?
Comment 3 Justin Hibbits freebsd_committer freebsd_triage 2019-11-03 18:09:46 UTC
It might only occur on non-x86 platforms.  I know it occurs on powerpc64 with uboot.  It might occur on an ARM platform with a PCIe graphics card (highly unlikely that would ever happen).  But, the direct use of the RLEs is incorrect, and the public API should be used instead anyway.  So much of the work can be done and tested on x86.
Comment 4 Mark Linimon freebsd_committer freebsd_triage 2023-07-25 19:42:08 UTC
To jhibbits: is this PR still relevant?