Re: [PATCH v3 2/6] LoongArch/PCI: Refresh screen_info after resource assignment

From: Thomas Zimmermann

Date: Tue Nov 10 2026 - 09:53:58 EST


Hi

Am 10.11.26 um 09:56 schrieb wuqianhai@xxxxxxxxxxx:
From: wuqianhai <wuqianhai@xxxxxxxxxxx>

PCI resource assignment runs from acpi_init() at subsys_initcall time.
The firmware framebuffer BAR can be relocated, leaving screen_info's
lfb_base stale. vga_arb_device_init() runs later at subsys_initcall_sync
time and reads screen_info to identify the firmware default VGA device.

Update screen_info through the generic screen_info_apply_fixups() helper
right after the root bus resources have been assigned, so both the VGA
arbiter and sysfb_init() observe the final framebuffer address.

I don't know much about the internals of the PCI subsystem.  But I would assume that there's a common function that sets up PCI resources on all architectures. And this is the place where we'd want to call screen_info_apply_fixups().

Best regards
Thomas



Signed-off-by: wuqianhai <wuqianhai@xxxxxxxxxxx>
---
arch/loongarch/pci/acpi.c | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/arch/loongarch/pci/acpi.c b/arch/loongarch/pci/acpi.c
index ccbcea61fcd9..cb313ff67f7e 100644
--- a/arch/loongarch/pci/acpi.c
+++ b/arch/loongarch/pci/acpi.c
@@ -9,6 +9,7 @@
#include <linux/slab.h>
#include <linux/pci-acpi.h>
#include <linux/pci-ecam.h>
+#include <linux/screen_info.h>
#include <asm/pci.h>
#include <asm/numa.h>
@@ -256,6 +257,9 @@ struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root)
*/
pci_assign_unassigned_root_bus_resources(bus);
+ if (IS_ENABLED(CONFIG_SCREEN_INFO))
+ screen_info_apply_fixups();
+
list_for_each_entry(child, &bus->children, node)
pcie_bus_configure_settings(child);
}

--
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstr. 146, 90461 Nürnberg, Germany, www.suse.com
GF: Stefan Gaiser, Jochen Jaser, Abhinav Puri, (HRB 36809, AG Nürnberg)