summaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2012-12-04 17:01:25 +0100
committerTakashi Iwai <tiwai@suse.de>2012-12-12 11:32:56 +0100
commitc5c215232dfb71d1cf2cc8627bdc2206726aa8a3 (patch)
treeec7198f923b216a9701943479560c219ffa8ab9f /sound
parent1d31affbef40cea4958da03cf6ec3cea1c7f801e (diff)
downloadlinux-c5c215232dfb71d1cf2cc8627bdc2206726aa8a3.tar.bz2
ALSA: hda - Avoid doubly suspend after vga switcheroo
The HD-audio driver artificially calls the suspend and the resume code path in the VGA switcheroo state changes. When a machine goes to suspend, it tries to suspend the device again, and it stalls at snd_power_wait(). This patch adds checks whether the devices were already in (forced) suspend in PM callbacks for avoiding the doubly suspend. Reported-by: Daniel J Blueman <daniel@quora.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/hda/hda_intel.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index eb88c528e120..1da8a5c9b9e1 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -2630,6 +2630,9 @@ static int azx_suspend(struct device *dev)
struct azx *chip = card->private_data;
struct azx_pcm *p;
+ if (chip->disabled)
+ return 0;
+
snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
azx_clear_irq_pending(chip);
list_for_each_entry(p, &chip->pcm_list, list)
@@ -2655,6 +2658,9 @@ static int azx_resume(struct device *dev)
struct snd_card *card = dev_get_drvdata(dev);
struct azx *chip = card->private_data;
+ if (chip->disabled)
+ return 0;
+
pci_set_power_state(pci, PCI_D0);
pci_restore_state(pci);
if (pci_enable_device(pci) < 0) {