aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2012-05-08 10:30:59 -0400
committerTakashi Iwai <tiwai@suse.de>2012-05-08 10:35:42 -0400
commit619a341b78f17fb86d92e89c04612676cd05e26f (patch)
tree5591466d5546206424eafc7eeaeb79738e48d53d /sound
parentaf741c150f66db8d1da6f82ac75e2571f7f1dd38 (diff)
Revert "ALSA: hda - Set codec to D3 forcibly even if not used"
This reverts commit 785f857d1cb0856b612b46a0545b74aa2596e44a. The commit causes a problem with the wrong D3 state after suspend because the call of hda_set_power_state() involves with the power-up sequence, which changes the power_count, and this confuses the resume sequence that checks the power_count as well. Originally, this go-to-D3 sequence should be a simple task without the power-up sequence. But, it'd need some proper sanity checks in the case of power-saved state, so it's not too easy to write now in the 3.4-rc cycle. In short, the safest option now is to revert this affecting commit. Of course, we need to clean up and robustify the power-saving code better for 3.5 kernel. Reported-by: Konstantin Khlebnikov <khlebnikov@openvz.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/hda/hda_codec.c4
-rw-r--r--sound/pci/hda/hda_intel.c14
2 files changed, 13 insertions, 5 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 7a8fcc4c15f8..841475cc13b6 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -5444,10 +5444,6 @@ int snd_hda_suspend(struct hda_bus *bus)
5444 list_for_each_entry(codec, &bus->codec_list, list) { 5444 list_for_each_entry(codec, &bus->codec_list, list) {
5445 if (hda_codec_is_power_on(codec)) 5445 if (hda_codec_is_power_on(codec))
5446 hda_call_codec_suspend(codec); 5446 hda_call_codec_suspend(codec);
5447 else /* forcibly change the power to D3 even if not used */
5448 hda_set_power_state(codec,
5449 codec->afg ? codec->afg : codec->mfg,
5450 AC_PWRST_D3);
5451 if (codec->patch_ops.post_suspend) 5447 if (codec->patch_ops.post_suspend)
5452 codec->patch_ops.post_suspend(codec); 5448 codec->patch_ops.post_suspend(codec);
5453 } 5449 }
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index c19e71a94e1b..6e958bf94191 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -2351,6 +2351,17 @@ static void azx_power_notify(struct hda_bus *bus)
2351 * power management 2351 * power management
2352 */ 2352 */
2353 2353
2354static int snd_hda_codecs_inuse(struct hda_bus *bus)
2355{
2356 struct hda_codec *codec;
2357
2358 list_for_each_entry(codec, &bus->codec_list, list) {
2359 if (snd_hda_codec_needs_resume(codec))
2360 return 1;
2361 }
2362 return 0;
2363}
2364
2354static int azx_suspend(struct pci_dev *pci, pm_message_t state) 2365static int azx_suspend(struct pci_dev *pci, pm_message_t state)
2355{ 2366{
2356 struct snd_card *card = pci_get_drvdata(pci); 2367 struct snd_card *card = pci_get_drvdata(pci);
@@ -2397,7 +2408,8 @@ static int azx_resume(struct pci_dev *pci)
2397 return -EIO; 2408 return -EIO;
2398 azx_init_pci(chip); 2409 azx_init_pci(chip);
2399 2410
2400 azx_init_chip(chip, 1); 2411 if (snd_hda_codecs_inuse(chip->bus))
2412 azx_init_chip(chip, 1);
2401 2413
2402 snd_hda_resume(chip->bus); 2414 snd_hda_resume(chip->bus);
2403 snd_power_change_state(card, SNDRV_CTL_POWER_D0); 2415 snd_power_change_state(card, SNDRV_CTL_POWER_D0);