diff options
author | Takashi Iwai <tiwai@suse.de> | 2012-11-19 15:25:27 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2012-11-19 15:25:27 -0500 |
commit | 87af0b80c933f05a4c7dd8c5edebe10365e76220 (patch) | |
tree | 6c33ab1a47b5f1ef196e8847586fb81b17152a0e /sound/pci/hda/hda_codec.c | |
parent | 08a978db518dfceb37998bc74a7fed03540cfd08 (diff) | |
parent | 2ea3c6a2c779e5a6487d2b436770232162dfbbe3 (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.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index a8e7b00fe90d..d9fd439209df 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, | |||
228 | } | 228 | } |
229 | mutex_unlock(&bus->cmd_mutex); | 229 | mutex_unlock(&bus->cmd_mutex); |
230 | snd_hda_power_down(codec); | 230 | snd_hda_power_down(codec); |
231 | if (res && *res == -1 && bus->rirb_error) { | 231 | if (!codec->in_pm && res && *res == -1 && bus->rirb_error) { |
232 | if (bus->response_reset) { | 232 | if (bus->response_reset) { |
233 | snd_printd("hda_codec: resetting BUS due to " | 233 | snd_printd("hda_codec: resetting BUS due to " |
234 | "fatal communication error\n"); | 234 | "fatal communication error\n"); |
@@ -238,7 +238,7 @@ static int codec_exec_verb(struct hda_codec *codec, unsigned int cmd, | |||
238 | goto again; | 238 | goto again; |
239 | } | 239 | } |
240 | /* clear reset-flag when the communication gets recovered */ | 240 | /* clear reset-flag when the communication gets recovered */ |
241 | if (!err) | 241 | if (!err || codec->in_pm) |
242 | bus->response_reset = 0; | 242 | bus->response_reset = 0; |
243 | return err; | 243 | return err; |
244 | } | 244 | } |
@@ -3655,6 +3655,8 @@ static unsigned int hda_call_codec_suspend(struct hda_codec *codec, bool in_wq) | |||
3655 | { | 3655 | { |
3656 | unsigned int state; | 3656 | unsigned int state; |
3657 | 3657 | ||
3658 | codec->in_pm = 1; | ||
3659 | |||
3658 | if (codec->patch_ops.suspend) | 3660 | if (codec->patch_ops.suspend) |
3659 | codec->patch_ops.suspend(codec); | 3661 | codec->patch_ops.suspend(codec); |
3660 | hda_cleanup_all_streams(codec); | 3662 | hda_cleanup_all_streams(codec); |
@@ -3669,6 +3671,7 @@ static unsigned int hda_call_codec_suspend(struct hda_codec *codec, bool in_wq) | |||
3669 | codec->power_transition = 0; | 3671 | codec->power_transition = 0; |
3670 | codec->power_jiffies = jiffies; | 3672 | codec->power_jiffies = jiffies; |
3671 | spin_unlock(&codec->power_lock); | 3673 | spin_unlock(&codec->power_lock); |
3674 | codec->in_pm = 0; | ||
3672 | return state; | 3675 | return state; |
3673 | } | 3676 | } |
3674 | 3677 | ||
@@ -3677,6 +3680,8 @@ static unsigned int hda_call_codec_suspend(struct hda_codec *codec, bool in_wq) | |||
3677 | */ | 3680 | */ |
3678 | static void hda_call_codec_resume(struct hda_codec *codec) | 3681 | static void hda_call_codec_resume(struct hda_codec *codec) |
3679 | { | 3682 | { |
3683 | codec->in_pm = 1; | ||
3684 | |||
3680 | /* set as if powered on for avoiding re-entering the resume | 3685 | /* set as if powered on for avoiding re-entering the resume |
3681 | * in the resume / power-save sequence | 3686 | * in the resume / power-save sequence |
3682 | */ | 3687 | */ |
@@ -3700,6 +3705,8 @@ static void hda_call_codec_resume(struct hda_codec *codec) | |||
3700 | snd_hda_jack_set_dirty_all(codec); | 3705 | snd_hda_jack_set_dirty_all(codec); |
3701 | snd_hda_jack_report_sync(codec); | 3706 | snd_hda_jack_report_sync(codec); |
3702 | } | 3707 | } |
3708 | |||
3709 | codec->in_pm = 0; | ||
3703 | snd_hda_power_down(codec); /* flag down before returning */ | 3710 | snd_hda_power_down(codec); /* flag down before returning */ |
3704 | } | 3711 | } |
3705 | #endif /* CONFIG_PM */ | 3712 | #endif /* CONFIG_PM */ |