On Fri, Dec 17, 2021 at 11:29:28AM -0600, Bjorn Helgaas wrote: > Hi Ville, > > Thanks for the report! > > On Fri, Dec 17, 2021 at 12:44:51PM +0200, Ville Syrjälä wrote: > > Hi, > > > > The pci sysfs "rom" file has disappeared for VGA devices. > > Looks to be a regression from commit 527139d738d7 ("PCI/sysfs: > > Convert "rom" to static attribute"). > > > > Some kind of ordering issue between the sysfs file creation > > vs. pci_fixup_video() perhaps? > > Can you attach your complete "lspci -vv" output? Also, which is the > default device? I think there's a "boot_vga" sysfs file that shows > this. "find /sys -name boot_vga | xargs grep ." All I have is Intel iGPUs so it's always 00:02.0. $ cat /sys/bus/pci/devices/0000\:00\:02.0/boot_vga 1 $ cat /sys/bus/pci/devices/0000\:00\:02.0/rom cat: '/sys/bus/pci/devices/0000:00:02.0/rom': No such file or directory I've attached the full lspci from my IVB laptop, but the problem happens on every machine (with an iGPU at least). I presume with a discrete GPU it might not happen since they actually have a real ROM. > > I think the relevant path is something like this: > > acpi_pci_root_add > pci_acpi_scan_root > ... > pci_scan_single_device > pci_device_add > device_add > ... > sysfs_create_groups > ... > if (grp->is_visible()) > pci_dev_rom_attr_is_visible # after 527139d738d7 > if (pci_resource_len(pdev, PCI_ROM_RESOURCE)) > ... > pci_bus_add_devices > pci_bus_add_device > pci_fixup_device(pci_fixup_final) > pci_fixup_video > if (vga_default_device() ...) > # update PCI_ROM_RESOURCE > pci_create_sysfs_dev_files > if (pci_resource_len(pdev, PCI_ROM_RESOURCE)) > sysfs_create_bin_file("rom") # before 527139d738d7 > > Prior to 527139d738d7, we ran pci_fixup_video() in > pci_bus_add_devices(). The vga_default_device() there might depend on > the fact that we've discovered all the PCI devices. > > After 527139d738d7, we create the "rom" file in pci_device_add(), > which happens as we discover each device, so maybe we don't yet know > which device is the default VGA device. > > Bjorn -- Ville Syrjälä Intel