Linux kernel -stable discussions
 help / color / mirror / Atom feed
* FAILED: patch "[PATCH] ALSA: core: Check shutdown flag at D0 power-state, too" failed to apply to 5.10-stable tree
@ 2026-11-07 11:17 Sasha Levin
  2026-11-10 14:16 ` [PATCH 5.10.y 1/5] ALSA: control - introduce snd_ctl_notify_one() helper Sasha Levin
  0 siblings, 1 reply; 6+ messages in thread
From: Sasha Levin @ 2026-11-07 11:17 UTC (permalink / raw)
  To: tiwai; +Cc: stable

The patch below does not apply to the 5.10-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable@vger.kernel.org>.

To reproduce the conflict and resubmit, you may use the following commands:

git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.10.y
git checkout FETCH_HEAD
git cherry-pick -x ad63c5b62843895e8c3cd7291ed07cc659df0355
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable@vger.kernel.org>' --in-reply-to '20261107061731-failed-5.10-ad63c5b62843@kernel.org' --subject-prefix 'PATCH 5.10.y' 'HEAD^..'

Thanks,
Sasha

------------------ original commit in Linus's tree ------------------

From ad63c5b62843895e8c3cd7291ed07cc659df0355 Mon Sep 17 00:00:00 2001
From: Takashi Iwai <tiwai@suse.de>
Date: Tue, 29 Sep 2026 14:53:41 +0200
Subject: [PATCH] ALSA: core: Check shutdown flag at D0 power-state, too

The snd_power_ref_and_wait() skips the card->shutdown check when the
card is already in D0 state and immediately returns as successful, by
assuming the all-green in D0.  This assumption makes the code after
this sync point behaving as if all power is up and ready, even though
actually it might have been already at the disconnected state.

Add the missing check of shutdown flag there for the more consistent
behavior.

Cc: stable@vger.kernel.org
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20260929125346.1478631-2-tiwai@suse.de
---
 sound/core/init.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/sound/core/init.c b/sound/core/init.c
index 1bcb6a2e75507..a51b71812fd9b 100644
--- a/sound/core/init.c
+++ b/sound/core/init.c
@@ -1174,12 +1174,12 @@ EXPORT_SYMBOL(snd_card_file_remove);
 int snd_power_ref_and_wait(struct snd_card *card)
 {
 	snd_power_ref(card);
-	if (snd_power_get_state(card) == SNDRV_CTL_POWER_D0)
-		return 0;
-	wait_event_cmd(card->power_sleep,
-		       card->shutdown ||
-		       snd_power_get_state(card) == SNDRV_CTL_POWER_D0,
-		       snd_power_unref(card), snd_power_ref(card));
+	if (snd_power_get_state(card) != SNDRV_CTL_POWER_D0) {
+		wait_event_cmd(card->power_sleep,
+			       card->shutdown ||
+			       snd_power_get_state(card) == SNDRV_CTL_POWER_D0,
+			       snd_power_unref(card), snd_power_ref(card));
+	}
 	if (card->shutdown) {
 		snd_power_unref(card);
 		return  -ENODEV;
-- 
2.53.0





^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-11-10 14:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-07 11:17 FAILED: patch "[PATCH] ALSA: core: Check shutdown flag at D0 power-state, too" failed to apply to 5.10-stable tree Sasha Levin
2026-11-10 14:16 ` [PATCH 5.10.y 1/5] ALSA: control - introduce snd_ctl_notify_one() helper Sasha Levin
2026-11-10 14:16   ` [PATCH 5.10.y 2/5] ALSA: control: Track in-flight control read/write/tlv accesses Sasha Levin
2026-11-10 14:16   ` [PATCH 5.10.y 3/5] ALSA: core: Simplify snd_power_ref_and_wait() with the standard macro Sasha Levin
2026-11-10 14:16   ` [PATCH 5.10.y 4/5] ALSA: core: Fix unintuitive behavior of snd_power_ref_and_wait() Sasha Levin
2026-11-10 14:16   ` [PATCH 5.10.y 5/5] ALSA: core: Check shutdown flag at D0 power-state, too Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox