Commit 4da63c6f authored by Takashi Iwai's avatar Takashi Iwai

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: default avatarTakashi Iwai <tiwai@suse.de>
parent cd50065b
...@@ -596,7 +596,7 @@ static int azx_suspend(struct device *dev) ...@@ -596,7 +596,7 @@ static int azx_suspend(struct device *dev)
struct azx *chip = card->private_data; struct azx *chip = card->private_data;
struct azx_pcm *p; struct azx_pcm *p;
if (chip->disabled) if (chip->disabled || chip->init_failed)
return 0; return 0;
snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
...@@ -628,7 +628,7 @@ static int azx_resume(struct device *dev) ...@@ -628,7 +628,7 @@ static int azx_resume(struct device *dev)
struct snd_card *card = dev_get_drvdata(dev); struct snd_card *card = dev_get_drvdata(dev);
struct azx *chip = card->private_data; struct azx *chip = card->private_data;
if (chip->disabled) if (chip->disabled || chip->init_failed)
return 0; return 0;
if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL) { if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL) {
...@@ -665,7 +665,7 @@ static int azx_runtime_suspend(struct device *dev) ...@@ -665,7 +665,7 @@ static int azx_runtime_suspend(struct device *dev)
struct snd_card *card = dev_get_drvdata(dev); struct snd_card *card = dev_get_drvdata(dev);
struct azx *chip = card->private_data; struct azx *chip = card->private_data;
if (chip->disabled) if (chip->disabled || chip->init_failed)
return 0; return 0;
if (!(chip->driver_caps & AZX_DCAPS_PM_RUNTIME)) if (!(chip->driver_caps & AZX_DCAPS_PM_RUNTIME))
...@@ -692,7 +692,7 @@ static int azx_runtime_resume(struct device *dev) ...@@ -692,7 +692,7 @@ static int azx_runtime_resume(struct device *dev)
struct hda_codec *codec; struct hda_codec *codec;
int status; int status;
if (chip->disabled) if (chip->disabled || chip->init_failed)
return 0; return 0;
if (!(chip->driver_caps & AZX_DCAPS_PM_RUNTIME)) if (!(chip->driver_caps & AZX_DCAPS_PM_RUNTIME))
...@@ -729,7 +729,7 @@ static int azx_runtime_idle(struct device *dev) ...@@ -729,7 +729,7 @@ static int azx_runtime_idle(struct device *dev)
struct snd_card *card = dev_get_drvdata(dev); struct snd_card *card = dev_get_drvdata(dev);
struct azx *chip = card->private_data; struct azx *chip = card->private_data;
if (chip->disabled) if (chip->disabled || chip->init_failed)
return 0; return 0;
if (!power_save_controller || if (!power_save_controller ||
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment