All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Kuan-Wei Chiu <visitorckw@gmail.com>
Cc: perex@perex.cz, tiwai@suse.com, gio.spacedev@pm.me,
	austrum.lab@gmail.com, luke@ljones.dev,
	akpm@linux-foundation.org, jserv@ccns.ncku.edu.tw,
	chuang@cs.nycu.edu.tw, linux-sound@vger.kernel.org,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH] ALSA: hda: Fix headset detection failure due to unstable sort
Date: Tue, 28 Jan 2025 18:12:49 +0100	[thread overview]
Message-ID: <8734h2981a.wl-tiwai@suse.de> (raw)
In-Reply-To: <20250128165415.643223-1-visitorckw@gmail.com>

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@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>

Applied now.  Thanks.


Takashi

      reply	other threads:[~2025-01-28 17:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-28 16:54 [PATCH] ALSA: hda: Fix headset detection failure due to unstable sort Kuan-Wei Chiu
2025-01-28 17:12 ` Takashi Iwai [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8734h2981a.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=austrum.lab@gmail.com \
    --cc=chuang@cs.nycu.edu.tw \
    --cc=gio.spacedev@pm.me \
    --cc=jserv@ccns.ncku.edu.tw \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=luke@ljones.dev \
    --cc=perex@perex.cz \
    --cc=stable@vger.kernel.org \
    --cc=tiwai@suse.com \
    --cc=visitorckw@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.