mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Konstantin Khlebnikov <khlebnikov@openvz.org>
To: Takashi Iwai <tiwai@suse.de>
Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org,
	David Henningsson <david.henningsson@canonical.com>,
	Jaroslav Kysela <perex@perex.cz>
Subject: [PATCH bugfix v3.4] ALSA: hda - fix "silence after S3" regression
Date: Tue, 08 May 2012 17:08:10 +0400	[thread overview]
Message-ID: <20120508130810.17396.27499.stgit@zurg> (raw)
In-Reply-To: <4FA91A27.3030801@openvz.org>

This fixes regression in shd-hda-codec after 785f857d1cb0856b612b46a0545b74aa2
("ALSA: hda - Set codec to D3 forcibly even if not used")

hda_set_power_state() call must be explicitly protected against recursive
snd_hda_power_up/down() calls, otherwise it accidentally switches device into
D0 right before suspend. As result after resume sound device stays in D3 state
and does not works because driver believes that the device is on already.

Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org>
---
 sound/pci/hda/hda_codec.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 7a8fcc4..a0ea9d6 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -5444,10 +5444,14 @@ int snd_hda_suspend(struct hda_bus *bus)
 	list_for_each_entry(codec, &bus->codec_list, list) {
 		if (hda_codec_is_power_on(codec))
 			hda_call_codec_suspend(codec);
-		else /* forcibly change the power to D3 even if not used */
+		else {
+			/* forcibly change the power to D3 even if not used */
+			codec->power_transition = 1;
 			hda_set_power_state(codec,
 					    codec->afg ? codec->afg : codec->mfg,
 					    AC_PWRST_D3);
+			codec->power_transition = 0;
+		}
 		if (codec->patch_ops.post_suspend)
 			codec->patch_ops.post_suspend(codec);
 	}


  reply	other threads:[~2012-05-08 13:08 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-04  7:21 [ALSA hda 3.4-rc] suspend2ram regression in snd_hda_intel Konstantin Khlebnikov
2012-05-06  8:32 ` Konstantin Khlebnikov
2012-05-06 10:37   ` Takashi Iwai
2012-05-08  7:13     ` Konstantin Khlebnikov
2012-05-08  8:11       ` Takashi Iwai
2012-05-08  8:49         ` Takashi Iwai
2012-05-08 13:05           ` Konstantin Khlebnikov
2012-05-08 13:08             ` Konstantin Khlebnikov [this message]
2012-05-08 13:25               ` [PATCH bugfix v3.4] ALSA: hda - fix "silence after S3" regression Takashi Iwai
2012-05-08 13:38                 ` Konstantin Khlebnikov
2012-05-08 14:29                   ` Takashi Iwai

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=20120508130810.17396.27499.stgit@zurg \
    --to=khlebnikov@openvz.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=david.henningsson@canonical.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome