OSDN Git Service

ALSA: hda: Disable runtime resume at shutdown
authorTakashi Iwai <tiwai@suse.de>
Thu, 26 Aug 2021 15:47:52 +0000 (17:47 +0200)
committerTakashi Iwai <tiwai@suse.de>
Thu, 26 Aug 2021 15:48:32 +0000 (17:48 +0200)
commit2eaf1635f9d62a2774c1c8114db24456dfd00721
tree8cd6ce838f9efbc2aa315100cbd8bc4ff3271094
parent6e41340994e5b5bd9262246e8d1f64406d72ab8b
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: b98444ed597d ("ALSA: hda: Suspend codec at shutdown")
Reported-and-tested-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210826154752.25674-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/hda/hda_codec.c