Repository navigation
Conversation
- Add test/shell.d/hw-msi-test.sh with 11 detection tests - Replace lspci with sysfs reads for RTL8125B detection (aligns with PR omacom#11259)
- Add test/shell.d/hw-msi-test.sh with 11 detection tests - Replace lspci with sysfs reads for RTL8125B detection (aligns with PR omacom#11259)
8c89a5f to
f29ffad
Compare
|
173ede1 to
ab7aa26
Compare
|
The sysfs helpers look like the right direction (and avoid the lspci D3cold wake). Two consolidate notes:
|
lspci reads PCI config space, and the kernel resumes a runtime-suspended device to serve that read. On a hybrid laptop the discrete GPU idles in D3cold, so a bare lspci can take over a second waking it — a cost paid at the worst time: during config soaks and per-user setup. Read the vendor, device, and class IDs from cached sysfs fields instead, which never touch config space, via a small shared helper (install/helpers/pci-sysfs.sh). T2 and Broadcom parts match by vendor/device ID; Intel/AMD/Apple Intel-video packages by class prefix plus vendor; the nouveau cursor fix by the bound driver symlink (dropping its lspci-presence guard since sysfs is always there).
|
This pull request was classified at head Two things for whoever picks it up, checked against the diff: #12076 converts the same BCM43xx, T2, Vulkan and NVIDIA detection to sysfs with its own helpers, so the two overlap and only one approach should land; and the description still lists migrations and tests ( This now waits on the maintainer to decide what it is. |
Summary
Replace every
lspcicall with reads from/sys/bus/pci/devicesvia a small shared helper (install/helpers/pci-sysfs.sh).lspcireads PCI config space, which forces the kernel to runtime-suspend a device that has entered D3cold — on hybrid laptops this means a barelspcican take over a second waking the discrete GPU. The cached sysfs fields (vendor,device,class, and thedriversymlink) never touch config space, so nothing wakes.Motivation
On hybrid laptops the discrete GPU idles in D3cold, and reading PCI config space forces a resume. This pays the wake penalty during config soaks and per-user setup, at the worst time in the boot/install flow. The vendor, device, class, and bound-driver information is already available from sysfs files the kernel caches — nothing there touches the device.
What changed
New shared helper —
install/helpers/pci-sysfs.sh:omarchy-pci-id <vendor> [device ...]— match by vendor + device IDomarchy-pci-class-vendor <class> <vendor>— match by class prefix + vendoromarchy-pci-class-count <class>— count devices with a given class prefixomarchy-pci-driver <driver>— match by bound driver symlinkAll matchers walk
OMARCHY_PCI_DEVICES_PATH(defaulting to/sys/bus/pci/devices); tests point it at a fixture tree.Hardware detectors migrated (14 files):
bin/omarchy-hw-hybrid-gpu— GPU count viaomarchy-pci-class-count 0x03; also adds atimeoutguard aroundsupergfxctlso a wedged daemon no longer blocks the menubin/omarchy-hw-nvidia(new) — NVIDIA GPU detection viaomarchy-pci-class-vendor 0x03 0x10debin/omarchy-hw-intel-sof(new) — Intel SOF audio DSP detection viaomarchy-pci-class-vendor 0x04 0x8086install/hardware/vulkan.sh,install/hardware/pacman.sh,install/hardware/apple/fix-t2.sh,install/hardware/apple/fix-brcmfmac-supplicant.sh,install/hardware/fix-bcm43xx.sh,install/hardware/fix-yt6801-ethernet-adapter.sh,install/hardware/intel/fix-wifi7-eht.sh,bin/omarchy-install-gaming-gpu-lib32— all migrated to sysfs matchersNouveau cursor fix —
install/user/hardware/fix-nouveau-cursor.shnow usesomarchy-pci-driver nouveauinstead oflspcioutput, and no longer needs a guard that checked whetherlspciwas available (sysfs is always there).Migrations —
migrations/1784401744.sh,migrations/1785944594.sh,migrations/1786391100.shupdated to use the sysfs helpers.Why lspci hurts on hybrid laptops
The kernel exposes PCI config space through
/sys/bus/pci/devices/<slot>/config, and reading that file triggers a runtime resume if the device is suspended in D3cold.lspcireads config space for every PCI device it enumerates. On a hybrid laptop the discrete GPU typically sits in D3cold while the integrated GPU drives the display, so a singlelspcicall can force a >1 second wake — paid at the worst time: during config soaks and per-user setup. Thevendor,device,class, anddriversymlink in sysfs are cached by the kernel and served without waking the device.Files changed
install/helpers/pci-sysfs.shbin/omarchy-hw-hybrid-gpu,bin/omarchy-hw-nvidia(new),bin/omarchy-hw-intel-sof(new),bin/omarchy-install-gaming-gpu-lib32install/hardware/vulkan.sh,install/hardware/pacman.sh,install/hardware/apple/fix-t2.sh,install/hardware/apple/fix-brcmfmac-supplicant.sh,install/hardware/fix-bcm43xx.sh,install/hardware/fix-yt6801-ethernet-adapter.sh,install/hardware/intel/fix-wifi7-eht.shinstall/user/hardware/fix-nouveau-cursor.shmigrations/1784401744.sh,migrations/1785944594.sh,migrations/1786391100.shtest/shell.d/pci-sysfs-test.sh(new),test/shell.d/base-test.sh,test/shell.d/hw-hybrid-gpu-test.sh,test/shell.d/hw-nvidia-test.sh,test/shell.d/brcmfmac-supplicant-test.sh,test/shell.d/nouveau-cursor-test.sh,test/shell.d/t2-hardware-test.shTotal: 24 files, +319 / -97
Testing
./test/shellpassespci-sysfs-test.shexercises all four matchers against fixture treeshw-hybrid-gpu-test,hw-nvidia-test,t2-hardware-test,brcmfmac-supplicant-test,nouveau-cursor-test) updated to use the newwrite_pci_devices/bind_pci_drivertest helpers frombase-test.sh