aboutsummaryrefslogtreecommitdiff
path: root/sound/pci/hda/hda_codec.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2012-11-19 21:25:27 +0100
committerTakashi Iwai <tiwai@suse.de>2012-11-19 21:25:27 +0100
commit87af0b80c933f05a4c7dd8c5edebe10365e76220 (patch)
tree6c33ab1a47b5f1ef196e8847586fb81b17152a0e /sound/pci/hda/hda_codec.c
parent08a978db518dfceb37998bc74a7fed03540cfd08 (diff)
parent2ea3c6a2c779e5a6487d2b436770232162dfbbe3 (diff)
Merge branch 'for-linus' into for-next
Merge the recent HD-audio codec change for fixing recursive suspend calls. Conflicts: sound/pci/hda/hda_codec.c
Diffstat (limited to 'sound/pci/hda/hda_codec.c')
-rw-r--r--sound/pci/hda/hda_codec.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index a8e7b00fe90..d9fd439209d 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -228,7 +228,7 @@ static int codec_exec_verb(struct hda_codec *codec, unsigned int cmd,
}
mutex_unlock(&bus->cmd_mutex);
snd_hda_power_down(codec);
- if (res && *res == -1 && bus->rirb_error) {
+ if (!codec->in_pm && res && *res == -1 && bus->rirb_error) {
if (bus->response_reset) {
snd_printd("hda_codec: resetting BUS due to "
"fatal communication error\n");
@@ -238,7 +238,7 @@ static int codec_exec_verb(struct hda_codec *codec, unsigned int cmd,
goto again;
}
/* clear reset-flag when the communication gets recovered */
- if (!err)
+ if (!err || codec->in_pm)
bus->response_reset = 0;
return err;
}
@@ -3655,6 +3655,8 @@ static unsigned int hda_call_codec_suspend(struct hda_codec *codec, bool in_wq)
{
unsigned int state;
+ codec->in_pm = 1;
+
if (codec->patch_ops.suspend)
codec->patch_ops.suspend(codec);
hda_cleanup_all_streams(codec);
@@ -3669,6 +3671,7 @@ static unsigned int hda_call_codec_suspend(struct hda_codec *codec, bool in_wq)
codec->power_transition = 0;
codec->power_jiffies = jiffies;
spin_unlock(&codec->power_lock);
+ codec->in_pm = 0;
return state;
}
@@ -3677,6 +3680,8 @@ static unsigned int hda_call_codec_suspend(struct hda_codec *codec, bool in_wq)
*/
static void hda_call_codec_resume(struct hda_codec *codec)
{
+ codec->in_pm = 1;
+
/* set as if powered on for avoiding re-entering the resume
* in the resume / power-save sequence
*/
@@ -3700,6 +3705,8 @@ static void hda_call_codec_resume(struct hda_codec *codec)
snd_hda_jack_set_dirty_all(codec);
snd_hda_jack_report_sync(codec);
}
+
+ codec->in_pm = 0;
snd_hda_power_down(codec); /* flag down before returning */
}
#endif /* CONFIG_PM */