aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2014-07-15 09:19:43 -0400
committerTakashi Iwai <tiwai@suse.de>2014-07-15 09:19:43 -0400
commit4da63c6fc426023d1a20e45508c47d7d68c6a53d (patch)
tree6c9781df9a0f74afc9f9b5144db72623228ac05a /sound
parentcd50065b3be83a705635550c04e368f2a4cc44d0 (diff)
ALSA: hda - Fix broken PM due to incomplete i915 initialization
When the initialization of Intel HDMI controller fails due to missing i915 kernel symbols (e.g. HD-audio is built in while i915 is module), the driver discontinues the probe. However, since the probe was done asynchronously, the driver object still remains, thus the relevant PM ops are still called at suspend/resume. This results in the bad access to the incomplete audio card object, eventually leads to Oops or stall at PM. This patch adds the missing checks of chip->init_failed flag at each PM callback in order to fix the problem above. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=79561 Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/hda/hda_intel.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index d690c26a197c..83cd19017cf3 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -596,7 +596,7 @@ static int azx_suspend(struct device *dev)
596 struct azx *chip = card->private_data; 596 struct azx *chip = card->private_data;
597 struct azx_pcm *p; 597 struct azx_pcm *p;
598 598
599 if (chip->disabled) 599 if (chip->disabled || chip->init_failed)
600 return 0; 600 return 0;
601 601
602 snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); 602 snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
@@ -628,7 +628,7 @@ static int azx_resume(struct device *dev)
628 struct snd_card *card = dev_get_drvdata(dev); 628 struct snd_card *card = dev_get_drvdata(dev);
629 struct azx *chip = card->private_data; 629 struct azx *chip = card->private_data;
630 630
631 if (chip->disabled) 631 if (chip->disabled || chip->init_failed)
632 return 0; 632 return 0;
633 633
634 if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL) { 634 if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL) {
@@ -665,7 +665,7 @@ static int azx_runtime_suspend(struct device *dev)
665 struct snd_card *card = dev_get_drvdata(dev); 665 struct snd_card *card = dev_get_drvdata(dev);
666 struct azx *chip = card->private_data; 666 struct azx *chip = card->private_data;
667 667
668 if (chip->disabled) 668 if (chip->disabled || chip->init_failed)
669 return 0; 669 return 0;
670 670
671 if (!(chip->driver_caps & AZX_DCAPS_PM_RUNTIME)) 671 if (!(chip->driver_caps & AZX_DCAPS_PM_RUNTIME))
@@ -692,7 +692,7 @@ static int azx_runtime_resume(struct device *dev)
692 struct hda_codec *codec; 692 struct hda_codec *codec;
693 int status; 693 int status;
694 694
695 if (chip->disabled) 695 if (chip->disabled || chip->init_failed)
696 return 0; 696 return 0;
697 697
698 if (!(chip->driver_caps & AZX_DCAPS_PM_RUNTIME)) 698 if (!(chip->driver_caps & AZX_DCAPS_PM_RUNTIME))
@@ -729,7 +729,7 @@ static int azx_runtime_idle(struct device *dev)
729 struct snd_card *card = dev_get_drvdata(dev); 729 struct snd_card *card = dev_get_drvdata(dev);
730 struct azx *chip = card->private_data; 730 struct azx *chip = card->private_data;
731 731
732 if (chip->disabled) 732 if (chip->disabled || chip->init_failed)
733 return 0; 733 return 0;
734 734
735 if (!power_save_controller || 735 if (!power_save_controller ||