linux-stable/arch/mips/loongson64
Bjorn Helgaas 74e88eceb0 PCI/sysfs: Find shadow ROM before static attribute initialization
commit 66d28b21fe upstream.

Ville reported that the sysfs "rom" file for VGA devices disappeared after
527139d738 ("PCI/sysfs: Convert "rom" to static attribute").

Prior to 527139d738, FINAL fixups, including pci_fixup_video() where we
find shadow ROMs, were run before pci_create_sysfs_dev_files() created the
sysfs "rom" file.

After 527139d738, "rom" is a static attribute and is created before FINAL
fixups are run, so we didn't create "rom" files for shadow ROMs:

  acpi_pci_root_add
    ...
      pci_scan_single_device
        pci_device_add
          pci_fixup_video                    # <-- new HEADER fixup
          device_add
            ...
              if (grp->is_visible())
                pci_dev_rom_attr_is_visible  # after 527139d738
    pci_bus_add_devices
      pci_bus_add_device
        pci_fixup_device(pci_fixup_final)
          pci_fixup_video                    # <-- previous FINAL fixup
        pci_create_sysfs_dev_files
          if (pci_resource_len(pdev, PCI_ROM_RESOURCE))
            sysfs_create_bin_file("rom")     # before 527139d738

Change pci_fixup_video() to be a HEADER fixup so it runs before sysfs
static attributes are initialized.

Rename the Loongson pci_fixup_radeon() to pci_fixup_video() and make its
dmesg logging identical to the others since it is doing the same job.

Link: https://lore.kernel.org/r/YbxqIyrkv3GhZVxx@intel.com
Fixes: 527139d738 ("PCI/sysfs: Convert "rom" to static attribute")
Link: https://lore.kernel.org/r/20220126154001.16895-1-helgaas@kernel.org
Reported-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Tested-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Cc: stable@vger.kernel.org			# v5.13+
Cc: Huacai Chen <chenhuacai@kernel.org>
Cc: Jiaxun Yang <jiaxun.yang@flygoat.com>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Krzysztof Wilczyński <kw@linux.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-02-01 17:27:05 +01:00
..
boardinfo.c MIPS: Loongson64: Add /sys/firmware/lefi/boardinfo 2020-10-27 12:46:06 +01:00
cop2-ex.c MIPS: Loongson-3: Fix fp register access if MSA enabled 2020-09-22 13:07:22 +02:00
cpucfg-emul.c MIPS: Unify naming style of vendor CP0.Config6 bits 2020-07-08 11:15:53 +02:00
dma.c dma-direct: rename and cleanup __phys_to_dma 2020-09-11 09:14:43 +02:00
env.c MIPS: Loongson64: Remove a "set but not used" variable 2021-05-27 12:35:19 +02:00
hpet.c MIPS: Replace setup_irq() by request_irq() 2020-03-05 16:47:35 +01:00
init.c MIPS: loongson64: fix bug when PAGE_SIZE > 16KB 2021-03-25 10:48:42 +01:00
Kconfig MIPS: Loongson64: Mark RS780 HPET as broken 2020-04-20 19:37:01 +02:00
Makefile MIPS: Loongson64: Remove unused sysconf members 2021-03-12 11:09:09 +01:00
numa.c MIPS: loongsoon64: Reserve memory below starting pfn to prevent Oops 2021-06-29 10:15:46 +02:00
Platform Kbuild updates for v5.12 2021-02-25 10:17:31 -08:00
pm.c MIPS: Loongson64: Move files to the top-level directory 2019-11-01 14:31:28 -07:00
reset.c MIPS: Loongson64: Fix build error 'secondary_kexec_args' undeclared under !SMP 2021-05-11 22:21:21 +02:00
setup.c MIPS: Loongson64: Load built-in dtbs 2020-03-25 16:07:12 +01:00
smp.c MIPS: Loongson64: Make some functions static in smp.c 2021-06-01 11:17:01 +02:00
smp.h MIPS: Loongson64: Move files to the top-level directory 2019-11-01 14:31:28 -07:00
time.c MIPS: Loongson64: Add support for the Loongson-2K1000 to get cpu_clock_freq 2021-03-25 10:44:01 +01:00
vbios_quirk.c PCI/sysfs: Find shadow ROM before static attribute initialization 2022-02-01 17:27:05 +01:00