Skip to content

Commit 2eaf163

Browse files
committed
ALSA: hda: Disable runtime resume at shutdown
Although we modified the codec shutdown callback to perform runtime-suspend, it's still not fully effective, as this may be resumed again at any time later. For fixing such an unwanted resume, this patch replaces pm_runtime_suspend() with pm_runtime_force_suspend(), and call pm_runtime_disable() afterward. It assures to keep the device suspended. Also for code simplification, we apply the code unconditionally; when it's been already suspended, nothing would happen by calls of snd_pcm_suspend_all() and pm_runtime_force_suspend(), just proceed to pm_runtime_disable(). Fixes: b98444e ("ALSA: hda: Suspend codec at shutdown") Reported-and-tested-by: Vitaly Rodionov <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent 6e41340 commit 2eaf163

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

sound/pci/hda/hda_codec.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2986,13 +2986,11 @@ void snd_hda_codec_shutdown(struct hda_codec *codec)
29862986
{
29872987
struct hda_pcm *cpcm;
29882988

2989-
if (pm_runtime_suspended(hda_codec_dev(codec)))
2990-
return;
2991-
29922989
list_for_each_entry(cpcm, &codec->pcm_list_head, list)
29932990
snd_pcm_suspend_all(cpcm->pcm);
29942991

2995-
pm_runtime_suspend(hda_codec_dev(codec));
2992+
pm_runtime_force_suspend(hda_codec_dev(codec));
2993+
pm_runtime_disable(hda_codec_dev(codec));
29962994
}
29972995

29982996
/*

0 commit comments

Comments
 (0)