Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] PCI/VGA: stale screen_info on DT/non-x86 paths in
  vga_is_firmware_default()
--

commit cc9285f73294dc9c72f6466431882028a26deb92
Author: wuqianhai <[email protected]>

PCI/VGA: Enable firmware default device detection on LoongArch

This commit selects SCREEN_INFO for VGA_ARB on LoongArch and switches
vga_is_firmware_default() from a CONFIG_X86 guard to CONFIG_SCREEN_INFO.

> diff --git a/drivers/pci/vgaarb.c b/drivers/pci/vgaarb.c
> index 3e58b2c05c854..4528ad0386102 100644
> --- a/drivers/pci/vgaarb.c
> +++ b/drivers/pci/vgaarb.c
> @@ -566,7 +566,7 @@ EXPORT_SYMBOL(vga_put);
>  
>  static bool vga_is_firmware_default(struct pci_dev *pdev)
>  {
> -#if defined CONFIG_X86
> +#ifdef CONFIG_SCREEN_INFO
>       return pdev == screen_info_pci_dev(&sysfb_primary_display.screen);
>  #else
>       return false;

[Severity: Medium]
Does guarding this with CONFIG_SCREEN_INFO cause vga_is_firmware_default()
to read a stale sysfb_primary_display.screen.lfb_base on LoongArch
DeviceTree systems and other non-x86 EFI architectures (such as ARM64, ARM
and RISC-V with CONFIG_SYSFB=y)?

Commit "LoongArch/PCI: Refresh screen_info after resource assignment" only
adds screen_info_apply_fixups() to LoongArch's ACPI pci_acpi_scan_root().
When PCI probing runs via pci_host_probe() (e.g. loongson_pci_probe()) or
generic pci_acpi_scan_root() in drivers/pci/pci-acpi.c,
vga_arb_device_init() runs at subsys_initcall_sync time before
sysfb_init() calls screen_info_apply_fixups() at device_initcall time.  If
the firmware framebuffer BAR was relocated during resource assignment or
sits behind a host bridge with a non-zero CPU-to-PCI offset,
screen_info_pci_dev() will not match pdev and fails to select the firmware
default VGA device.

Also, the second paragraph of the commit message says the previous patch
handled screen_info staleness so vga_arb_device_init() no longer needs to
refresh screen_info itself, which looks like leftover commentary from an
earlier version of the series.

-- 
Sashiko AI review ยท 
https://sashiko.dev/#/patchset/[email protected]?part=6

Reply via email to