Bug 241651 - linuxkpi doesn't handle uninitialized PCI devices
Summary: linuxkpi doesn't handle uninitialized PCI devices
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: Hans Petter Selasky
Depends on:
Reported: 2019-11-01 22:00 UTC by Justin Hibbits
Modified: 2019-11-03 18:09 UTC (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Justin Hibbits freebsd_committer 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 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 2019-11-02 22:22:24 UTC
Is this relevant for i386 and amd64 or other platforms only?
Comment 3 Justin Hibbits freebsd_committer 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.