mirror of https://github.com/torvalds/linux.git
The acpi_cst_latency_cmp() comparison function currently used for
sorting C-state latencies does not satisfy transitivity, causing
incorrect sorting results.
Specifically, if there are two valid acpi_processor_cx elements A and B
and one invalid element C, it may occur that A < B, A = C, and B = C.
Sorting algorithms assume that if A < B and A = C, then C < B, leading
to incorrect ordering.
Given the small size of the array (<=8), we replace the library sort
function with a simple insertion sort that properly ignores invalid
elements and sorts valid ones based on latency. This change ensures
correct ordering of the C-state latencies.
Fixes:
|
||
|---|---|---|
| .. | ||
| acpica | ||
| apei | ||
| arm64 | ||
| dptf | ||
| nfit | ||
| numa | ||
| pmic | ||
| riscv | ||
| x86 | ||
| Kconfig | ||
| Makefile | ||
| ac.c | ||
| acpi_adxl.c | ||
| acpi_apd.c | ||
| acpi_configfs.c | ||
| acpi_dbg.c | ||
| acpi_extlog.c | ||
| acpi_ffh.c | ||
| acpi_fpdt.c | ||
| acpi_ipmi.c | ||
| acpi_lpat.c | ||
| acpi_lpit.c | ||
| acpi_memhotplug.c | ||
| acpi_pad.c | ||
| acpi_pcc.c | ||
| acpi_platform.c | ||
| acpi_pnp.c | ||
| acpi_processor.c | ||
| acpi_tad.c | ||
| acpi_video.c | ||
| acpi_watchdog.c | ||
| battery.c | ||
| bgrt.c | ||
| bus.c | ||
| button.c | ||
| container.c | ||
| cppc_acpi.c | ||
| debugfs.c | ||
| device_pm.c | ||
| device_sysfs.c | ||
| dock.c | ||
| ec.c | ||
| ec_sys.c | ||
| event.c | ||
| evged.c | ||
| fan.h | ||
| fan_attr.c | ||
| fan_core.c | ||
| glue.c | ||
| hed.c | ||
| internal.h | ||
| ioapic.c | ||
| irq.c | ||
| mipi-disco-img.c | ||
| nhlt.c | ||
| nvs.c | ||
| osi.c | ||
| osl.c | ||
| pci_irq.c | ||
| pci_link.c | ||
| pci_mcfg.c | ||
| pci_root.c | ||
| pci_slot.c | ||
| pfr_telemetry.c | ||
| pfr_update.c | ||
| platform_profile.c | ||
| power.c | ||
| pptt.c | ||
| prmt.c | ||
| proc.c | ||
| processor_core.c | ||
| processor_driver.c | ||
| processor_idle.c | ||
| processor_pdc.c | ||
| processor_perflib.c | ||
| processor_thermal.c | ||
| processor_throttling.c | ||
| property.c | ||
| reboot.c | ||
| resource.c | ||
| sbs.c | ||
| sbshc.c | ||
| sbshc.h | ||
| scan.c | ||
| sleep.c | ||
| sleep.h | ||
| spcr.c | ||
| sysfs.c | ||
| tables.c | ||
| thermal.c | ||
| thermal_lib.c | ||
| tiny-power-button.c | ||
| utils.c | ||
| video_detect.c | ||
| viot.c | ||
| wakeup.c | ||