fix(libkernel): skip power and network hwmon sensors before reading them #20677
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/20677"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-11-15T12:16:41Z.
What
ReadThermalSensorsread every hwmon'stemp1_inputbefore it checked the sensor'sname, and skipped battery, AC and wireless sensors (IsPowerOrNetwork) only after the read. Some of those sensors block when read. On a Linux host with a MediaTek MT7921 Wi-Fi card (mt7921_phy0), each read of itstemp1_inputblocks 6–13 s and then fails withETIMEDOUT. OneReadThermalSensorscall took about 75 s on that host; strace showed seven such reads. EverysceKernelGetCpuTemperatureandsceKernelGetSocSensorTemperaturecall goes through this function, so on such a host the calling guest thread stalls that long, and the value it waits for is discarded.The reader now reads
namefirst and skips power and network sensors without opening theirtemp1_input. Which sensors are used, and in what order, is unchanged.The test now also checks that a skipped sensor's
temp1_inputis never opened. Outside Windows, the battery and Wi-Fi sensors'temp1_inputis a FIFO with no writer, so an open would block and the test would fail on its 20 s timeout.Tested
Linux (Arch, kernel 7.2.14),
guest_thermal_sensors:ThermalSensors.cpp:***Timeout 20.05 sec(blocked opening the battery sensor's FIFO)Passed 0.02 secChecklist
main; no other open PR implements the same functions. #17652 moves this reader intoThermalReader.cppwith the same read order; whichever lands second carries the reorder.NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)