Re: [PATCH] PCI/VGA: Fix boot device detection after framebuffer relocation

From: wuqianhai

Date: Wed Oct 28 2026 - 23:42:24 EST


Hi Bjorn,

Thanks for the detailed analysis.

You're right that screen_info_fixup_lfb()/screen_info_apply_fixups()
stores a PCI bus address in screen_info_lfb_res_start and compares it
with the CPU address in pdev->resource[].start, which is broken on
systems where bus and CPU addresses differ.

On LoongArch, though, bus and CPU addresses are identical: with modern
firmware, acpi_prepare_root_resources() takes the PCIH path and leaves
the window offset at 0 (see commit 49f33840dcc9). So the existing
screen_info_apply_fixups() works correctly for LoongArch, and the
address-space confusion you describe does not trigger there.

I've sent a v2 that:
- enables vga_is_firmware_default() for LoongArch,
- restricts the screen_info_apply_fixups() call to LoongArch so x86 and
other architectures are unaffected,
- makes VGA_ARB select SYSFB on LoongArch to avoid the undefined
reference when CONFIG_SCREEN_INFO is not set.

The general bus != CPU problem in screen_info_pci.c is still worth
fixing for ARM and friends, but I'd rather keep that separate from this
LoongArch enablement. Happy to help with that follow-up if useful.

Regards,
wuqianhai