[alsa-devel] [PATCH] ALSA: hda - Disable runtime PM on LynxPoint(-LP) controllers

Takashi Iwai tiwai at suse.de
Wed Nov 20 13:05:23 CET 2013

At Wed, 20 Nov 2013 09:54:42 +0100,
David Henningsson wrote:
> (Adding Mengdong to cc)
> On 11/19/2013 05:51 PM, Takashi Iwai wrote:
> > We got bug reports of the stalled HD-audio, typically after S3 or S4,
> > and it turned out that they seemed triggered by runtime PM on Lynx
> > Point and Lynx Point-LP controllers.  As there is no way to recover
> > properly from the stalled controller, it's safer to disable the
> > runtime PM support on these chips for now.
> Oh, this is a bit sad news. Have you talked to Intel about it?
> Anyway, I saw something similar a while ago, but never with access to
> the hardware, and then it was difficult to reproduce for the person on
> the other side. Nevertheless, when I read through the PM code I found
> that the GCTL register was sometimes accessed with readb (although it is
> a 32 bit register), so I wrote a patch for that, but the testing results
> of this patch were a bit inconclusive, so I never upstreamed it.
> Anyway, I'm attaching the draft patch. Do you think it could be related?

It didn't change the behavior although the change looks good.

After a long debugging session in this morning, I finally nailed
down.  This was the fault in the sound driver after all, shamefully :)

The fix patch is below.

The code needs a bit clean up, and I have it, but will apply this for



From: Takashi Iwai <tiwai at suse.de>
Subject: [PATCH 1/2] ALSA: hda - Fix unbalanced runtime PM notification at

When a codec is resumed, it keeps the power on while the resuming
phase via hda_keep_power_on(), then turns down via
snd_hda_power_down().  At that point, snd_hda_power_down() notifies
the power down to the controller, and this may confuse the refcount if
the codec was already powered up before the resume.

In the end result, the controller goes to runtime suspend even before
the codec is kicked off to the power save, and the communication
stalls happens.

The fix is to add the power-up notification together with
hda_keep_power_on(), and clears the flag appropriately.

Cc: <stable at vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai at suse.de>
 sound/pci/hda/hda_codec.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index be60f5227b34..bada677df8a7 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -4058,6 +4058,10 @@ static void hda_call_codec_resume(struct hda_codec *codec)
 	 * in the resume / power-save sequence
+	if (codec->pm_down_notified) {
+		codec->pm_down_notified = 0;
+		hda_call_pm_notify(codec->bus, true);
+	}
 	hda_set_power_state(codec, AC_PWRST_D0);

More information about the Alsa-devel mailing list