From: Takashi Iwai <tiwai@suse.de>
To: Konstantin Khlebnikov <khlebnikov@openvz.org>
Cc: "alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
David Henningsson <david.henningsson@canonical.com>,
Jaroslav Kysela <perex@perex.cz>
Subject: Re: [PATCH bugfix v3.4] ALSA: hda - fix "silence after S3" regression
Date: Tue, 08 May 2012 16:29:38 +0200 [thread overview]
Message-ID: <s5haa1i21bh.wl%tiwai@suse.de> (raw)
In-Reply-To: <4FA921E5.4080305@openvz.org>
At Tue, 08 May 2012 17:38:45 +0400,
Konstantin Khlebnikov wrote:
>
> Takashi Iwai wrote:
> > At Tue, 08 May 2012 17:08:10 +0400,
> > Konstantin Khlebnikov wrote:
> >>
> >> 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>
> >
> > Hrm, does this really fix your problem? The path is called only
> > during the suspend. Then, in the resume path, the codec is all
> > powered up anyway.
>
> This fixes my problem: during suspend hda_set_power_state() calls snd_hda_power_up()
> it set codec->power_on = 1 and switches device into D0. At S3 resume codec->power_on == 1
> but all devices actually in D3 state. As result on resume path device stays in D3,
> but after one power-save cycle all works again.
Ah, thanks, that explains a lot.
Then it'd be actually better to revert the commit instead of another
hack to paper over the nasty reincarnation.
The power-state change there shouldn't be involved with the whole
power-up sequence. It should have been a simple "go-to-D3" sequence.
But this would need the assurance that the controller side is ready,
etc, and not too trivial to write with the current code base.
So, the right fix would be either implementing a straight
hda_set_power_state() code without any power-up sequence but only the
sanity check of the controller side, or fixing the original problem of
ALC269 differently, e.g. by always resuming immediately at the resume
callback but immediately performing the power-saving work.
In either way, it's too late for 3.4 kernel. And the original problem
is no critical issue in comparison with this regression. So, a revert
would be the best thing we can do for now, IMO.
> > If the race between the leftover power-save work is really a culprit,
> > the fix would be just calling cancel_delayed_work_sync() before
> > that point...
>
> Race was always there, my problem was caused by commit which mentioned above.
>
> Whole this code is very racy, someone needs to fix it.
Yeah, I know. I'll cook it up for 3.5 kernel.
thanks,
Takashi
prev parent reply other threads:[~2012-05-08 14:29 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 ` [PATCH bugfix v3.4] ALSA: hda - fix "silence after S3" regression Konstantin Khlebnikov
2012-05-08 13:25 ` Takashi Iwai
2012-05-08 13:38 ` Konstantin Khlebnikov
2012-05-08 14:29 ` 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=s5haa1i21bh.wl%tiwai@suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@alsa-project.org \
--cc=david.henningsson@canonical.com \
--cc=khlebnikov@openvz.org \
--cc=linux-kernel@vger.kernel.org \
--cc=perex@perex.cz \
/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
all inboxes | Powered by JetHome®