HomeFreeBSD

linuxkpi: Fix `pci_upstream_bridge()` with DRM devices

Description

linuxkpi: Fix pci_upstream_bridge() with DRM devices

In the case of DRM drivers, the passed device is a child of vgapci. We
want to start the lookup from vgapci, so the parent of the passed
drmn. We use the isdrm flag to determine if we are in this
situation.

This fixes an infinite loop with the amdgpu DRM driver that started to
use this function in Linux 6.8: pci_upstream_bridge() was returning
itself and the code in amdgpu was calling it again, hoping to get a
device with a vendor that is not "ATI".

Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D49388

Details

Provenance
dumbbellAuthored on Mar 3 2025, 11:48 PM
Reviewer
bz
Differential Revision
D49388: linuxkpi: Fix `pci_upstream_bridge()` with DRM devices
Parents
rGd9a2c2e250ae: linuxkpi: Add `memcpy_{from,to}_page()`
Branches
Unknown
Tags
Unknown