OpenCloudOS-Kernel/sound
Kuan-Wei Chiu 3cef733e15 ALSA: hda: Fix headset detection failure due to unstable sort
commit 3b4309546b48fc167aa615a2d881a09c0a97971f upstream.

The auto_parser assumed sort() was stable, but the kernel's sort() uses
heapsort, which has never been stable. After commit 0e02ca29a563
("lib/sort: optimize heapsort with double-pop variation"), the order of
equal elements changed, causing the headset to fail to work.

Fix the issue by recording the original order of elements before
sorting and using it as a tiebreaker for equal elements in the
comparison function.

Fixes: b9030a005d ("ALSA: hda - Use standard sort function in hda_auto_parser.c")
Reported-by: Austrum <austrum.lab@gmail.com>
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=219158
Tested-by: Austrum <austrum.lab@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Kuan-Wei Chiu <visitorckw@gmail.com>
Link: https://patch.msgid.link/20250128165415.643223-1-visitorckw@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-02-17 09:40:25 +01:00
..
ac97 ALSA: ac97: set variables dev_attr_vendor_id to static 2023-08-02 09:27:39 +02:00
aoa ALSA: aoa: Fix typos in PCM fix patch 2023-08-18 09:09:39 +02:00
arm ARM: pxa: fix missing-prototypes warnings 2023-05-26 13:33:05 +02:00
atmel ALSA: Explicitly include correct DT includes 2023-07-16 14:50:56 +02:00
core ALSA: seq: Make dependency on UMP clearer 2025-02-08 09:52:07 +01:00
drivers ALSA: pcmtest: stop timer before buffer is released 2024-01-20 11:51:42 +01:00
firewire ALSA: firewire-lib: fix return value on fail in amdtp_tscm_init() 2024-11-14 13:19:33 +01:00
hda ASoC: Intel: sst: Support LPE0F28 ACPI HID 2024-12-09 10:31:36 +01:00
i2c
isa ALSA: gus: Fix some error handling paths related to get_bpos() usage 2024-10-10 11:57:20 +02:00
mips
oss
parisc
pci ALSA: hda: Fix headset detection failure due to unstable sort 2025-02-17 09:40:25 +01:00
pcmcia ALSA: add HAS_IOPORT dependencies 2023-05-22 16:43:47 +02:00
ppc ALSA: Explicitly include correct DT includes 2023-07-16 14:50:56 +02:00
sh ALSA: sh: Fix wrong argument order for copy_from_iter() 2025-01-02 10:32:11 +01:00
soc ASoC: acp: Support microphone from Lenovo Go S 2025-02-17 09:40:24 +01:00
sparc ALSA: Explicitly include correct DT includes 2023-07-16 14:50:56 +02:00
spi
synth ALSA: emux: improve patch ioctl data validation 2024-07-05 09:33:52 +02:00
usb ALSA: usb-audio: Add delay quirk for iBasso DC07 Pro 2025-02-08 09:52:36 +01:00
virtio
x86
xen ALSA: xen: Fix -Wformat-truncation warning 2023-09-15 13:21:35 +02:00
Kconfig sound: Make CONFIG_SND depend on INDIRECT_IOMEM instead of UML 2024-11-17 15:08:56 +01:00
Makefile
ac97_bus.c
last.c
sound_core.c sound: make all 'class' structures const 2023-06-21 07:29:10 +02:00