aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sound/pci/hda/hda_codec.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 960800b862ab..c0ab72cbeed1 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -3612,7 +3612,7 @@ static inline void hda_exec_init_verbs(struct hda_codec *codec) {}
3612 * call suspend and power-down; used both from PM and power-save 3612 * call suspend and power-down; used both from PM and power-save
3613 * this function returns the power state in the end 3613 * this function returns the power state in the end
3614 */ 3614 */
3615static unsigned int hda_call_codec_suspend(struct hda_codec *codec) 3615static unsigned int hda_call_codec_suspend(struct hda_codec *codec, bool in_wq)
3616{ 3616{
3617 unsigned int state; 3617 unsigned int state;
3618 3618
@@ -3620,7 +3620,9 @@ static unsigned int hda_call_codec_suspend(struct hda_codec *codec)
3620 codec->patch_ops.suspend(codec); 3620 codec->patch_ops.suspend(codec);
3621 hda_cleanup_all_streams(codec); 3621 hda_cleanup_all_streams(codec);
3622 state = hda_set_power_state(codec, AC_PWRST_D3); 3622 state = hda_set_power_state(codec, AC_PWRST_D3);
3623 cancel_delayed_work(&codec->power_work); 3623 /* Cancel delayed work if we aren't currently running from it. */
3624 if (!in_wq)
3625 cancel_delayed_work_sync(&codec->power_work);
3624 spin_lock(&codec->power_lock); 3626 spin_lock(&codec->power_lock);
3625 snd_hda_update_power_acct(codec); 3627 snd_hda_update_power_acct(codec);
3626 trace_hda_power_down(codec); 3628 trace_hda_power_down(codec);
@@ -4478,7 +4480,7 @@ static void hda_power_work(struct work_struct *work)
4478 } 4480 }
4479 spin_unlock(&codec->power_lock); 4481 spin_unlock(&codec->power_lock);
4480 4482
4481 state = hda_call_codec_suspend(codec); 4483 state = hda_call_codec_suspend(codec, true);
4482 codec->pm_down_notified = 0; 4484 codec->pm_down_notified = 0;
4483 if (!bus->power_keep_link_on && (state & AC_PWRST_CLK_STOP_OK)) { 4485 if (!bus->power_keep_link_on && (state & AC_PWRST_CLK_STOP_OK)) {
4484 codec->pm_down_notified = 1; 4486 codec->pm_down_notified = 1;
@@ -5127,7 +5129,7 @@ int snd_hda_suspend(struct hda_bus *bus)
5127 5129
5128 list_for_each_entry(codec, &bus->codec_list, list) { 5130 list_for_each_entry(codec, &bus->codec_list, list) {
5129 if (hda_codec_is_power_on(codec)) 5131 if (hda_codec_is_power_on(codec))
5130 hda_call_codec_suspend(codec); 5132 hda_call_codec_suspend(codec, false);
5131 } 5133 }
5132 return 0; 5134 return 0;
5133} 5135}