aboutsummaryrefslogtreecommitdiffstats
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
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>
-rw-r--r--drivers/gpu/drm/i915/intel_pm.c14
-rw-r--r--include/drm/i915_powerwell.h4
-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
5 files changed, 24 insertions, 17 deletions
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index d1e53abec1b5..6463f0201cf2 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -6024,30 +6024,32 @@ void intel_display_power_put(struct drm_i915_private *dev_priv,
6024static struct i915_power_domains *hsw_pwr; 6024static struct i915_power_domains *hsw_pwr;
6025 6025
6026/* Display audio driver power well request */ 6026/* Display audio driver power well request */
6027void i915_request_power_well(void) 6027int i915_request_power_well(void)
6028{ 6028{
6029 struct drm_i915_private *dev_priv; 6029 struct drm_i915_private *dev_priv;
6030 6030
6031 if (WARN_ON(!hsw_pwr)) 6031 if (!hsw_pwr)
6032 return; 6032 return -ENODEV;
6033 6033
6034 dev_priv = container_of(hsw_pwr, struct drm_i915_private, 6034 dev_priv = container_of(hsw_pwr, struct drm_i915_private,
6035 power_domains); 6035 power_domains);
6036 intel_display_power_get(dev_priv, POWER_DOMAIN_AUDIO); 6036 intel_display_power_get(dev_priv, POWER_DOMAIN_AUDIO);
6037 return 0;
6037} 6038}
6038EXPORT_SYMBOL_GPL(i915_request_power_well); 6039EXPORT_SYMBOL_GPL(i915_request_power_well);
6039 6040
6040/* Display audio driver power well release */ 6041/* Display audio driver power well release */
6041void i915_release_power_well(void) 6042int i915_release_power_well(void)
6042{ 6043{
6043 struct drm_i915_private *dev_priv; 6044 struct drm_i915_private *dev_priv;
6044 6045
6045 if (WARN_ON(!hsw_pwr)) 6046 if (!hsw_pwr)
6046 return; 6047 return -ENODEV;
6047 6048
6048 dev_priv = container_of(hsw_pwr, struct drm_i915_private, 6049 dev_priv = container_of(hsw_pwr, struct drm_i915_private,
6049 power_domains); 6050 power_domains);
6050 intel_display_power_put(dev_priv, POWER_DOMAIN_AUDIO); 6051 intel_display_power_put(dev_priv, POWER_DOMAIN_AUDIO);
6052 return 0;
6051} 6053}
6052EXPORT_SYMBOL_GPL(i915_release_power_well); 6054EXPORT_SYMBOL_GPL(i915_release_power_well);
6053 6055
diff --git a/include/drm/i915_powerwell.h b/include/drm/i915_powerwell.h
index cfdc884405b7..2baba9996094 100644
--- a/include/drm/i915_powerwell.h
+++ b/include/drm/i915_powerwell.h
@@ -30,7 +30,7 @@
30#define _I915_POWERWELL_H_ 30#define _I915_POWERWELL_H_
31 31
32/* For use by hda_i915 driver */ 32/* For use by hda_i915 driver */
33extern void i915_request_power_well(void); 33extern int i915_request_power_well(void);
34extern void i915_release_power_well(void); 34extern int i915_release_power_well(void);
35 35
36#endif /* _I915_POWERWELL_H_ */ 36#endif /* _I915_POWERWELL_H_ */
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);