[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <8734h2981a.wl-tiwai@suse.de>
Date: Tue, 28 Jan 2025 18:12:49 +0100
From: Takashi Iwai <tiwai@...e.de>
To: Kuan-Wei Chiu <visitorckw@...il.com>
Cc: perex@...ex.cz,
tiwai@...e.com,
gio.spacedev@...me,
austrum.lab@...il.com,
luke@...nes.dev,
akpm@...ux-foundation.org,
jserv@...s.ncku.edu.tw,
chuang@...nycu.edu.tw,
linux-sound@...r.kernel.org,
linux-kernel@...r.kernel.org,
stable@...r.kernel.org
Subject: Re: [PATCH] ALSA: hda: Fix headset detection failure due to unstable sort
On Tue, 28 Jan 2025 17:54:15 +0100,
Kuan-Wei Chiu wrote:
>
> 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: b9030a005d58 ("ALSA: hda - Use standard sort function in hda_auto_parser.c")
> Reported-by: Austrum <austrum.lab@...il.com>
> Closes: https://bugzilla.kernel.org/show_bug.cgi?id=219158
> Tested-by: Austrum <austrum.lab@...il.com>
> Cc: stable@...r.kernel.org
> Signed-off-by: Kuan-Wei Chiu <visitorckw@...il.com>
Applied now. Thanks.
Takashi
Powered by blists - more mailing lists