aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2014-06-13 09:14:34 -0400
committerTakashi Iwai <tiwai@suse.de>2014-06-16 04:34:06 -0400
commit74b0c2d75fb4cc89173944e6d8f9eb47aca0c343 (patch)
treefa5d2e9b60d699e7d22e9f1b128f0299452e20a4 /sound/pci
parent7171511eaec5bf23fb06078f59784a3a0626b38f (diff)
drm/i915, HD-audio: Don't continue probing when nomodeset is given
When a machine is booted with nomodeset option, i915 driver skips the whole initialization. Meanwhile, HD-audio tries to bind wth i915 just by request_symbol() without knowing that the initialization was skipped, and eventually it hits WARN_ON() in i915_request_power_well() and i915_release_power_well() wrongly but still continues probing, even though it doesn't work at all. In this patch, both functions are changed to return an error in case of uninitialized state instead of WARN_ON(), so that HD-audio driver can give up HDMI controller initialization at the right time. Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: <stable@vger.kernel.org> [3.15] Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/hda/hda_i915.c12
-rw-r--r--sound/pci/hda/hda_i915.h4
-rw-r--r--sound/pci/hda/hda_intel.c7
3 files changed, 14 insertions, 9 deletions
diff --git a/sound/pci/hda/hda_i915.c b/sound/pci/hda/hda_i915.c
index 9d07e4edacdb..e9e8a4a4a9a1 100644
--- a/sound/pci/hda/hda_i915.c
+++ b/sound/pci/hda/hda_i915.c
@@ -22,20 +22,20 @@
22#include <drm/i915_powerwell.h> 22#include <drm/i915_powerwell.h>
23#include "hda_i915.h" 23#include "hda_i915.h"
24 24
25static void (*get_power)(void); 25static int (*get_power)(void);
26static void (*put_power)(void); 26static int (*put_power)(void);
27 27
28void hda_display_power(bool enable) 28int hda_display_power(bool enable)
29{ 29{
30 if (!get_power || !put_power) 30 if (!get_power || !put_power)
31 return; 31 return -ENODEV;
32 32
33 pr_debug("HDA display power %s \n", 33 pr_debug("HDA display power %s \n",
34 enable ? "Enable" : "Disable"); 34 enable ? "Enable" : "Disable");
35 if (enable) 35 if (enable)
36 get_power(); 36 return get_power();
37 else 37 else
38 put_power(); 38 return put_power();
39} 39}
40 40
41int hda_i915_init(void) 41int hda_i915_init(void)
diff --git a/sound/pci/hda/hda_i915.h b/sound/pci/hda/hda_i915.h
index 5a63da2c53e5..bfd835f8f1aa 100644
--- a/sound/pci/hda/hda_i915.h
+++ b/sound/pci/hda/hda_i915.h
@@ -17,11 +17,11 @@
17#define __SOUND_HDA_I915_H 17#define __SOUND_HDA_I915_H
18 18
19#ifdef CONFIG_SND_HDA_I915 19#ifdef CONFIG_SND_HDA_I915
20void hda_display_power(bool enable); 20int hda_display_power(bool enable);
21int hda_i915_init(void); 21int hda_i915_init(void);
22int hda_i915_exit(void); 22int hda_i915_exit(void);
23#else 23#else
24static inline void hda_display_power(bool enable) {} 24static inline int hda_display_power(bool enable) { return 0; }
25static inline int hda_i915_init(void) 25static inline int hda_i915_init(void)
26{ 26{
27 return -ENODEV; 27 return -ENODEV;
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index bb65a124e006..23fd6b9aecca 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -1656,8 +1656,13 @@ static int azx_probe_continue(struct azx *chip)
1656 "Error request power-well from i915\n"); 1656 "Error request power-well from i915\n");
1657 goto out_free; 1657 goto out_free;
1658 } 1658 }
1659 err = hda_display_power(true);
1660 if (err < 0) {
1661 dev_err(chip->card->dev,
1662 "Cannot turn on display power on i915\n");
1663 goto out_free;
1664 }
1659#endif 1665#endif
1660 hda_display_power(true);
1661 } 1666 }
1662 1667
1663 err = azx_first_init(chip); 1668 err = azx_first_init(chip);