diff options
author | Kai-Heng Feng <kai.heng.feng@canonical.com> | 2021-01-19 18:21:43 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-01-27 13:55:10 +0300 |
commit | 517732c1b52b54824df68bb72b4030065e1aad47 (patch) | |
tree | 99456d410de9243c05659d4434c2d8a42abd0bbc /net | |
parent | ca431352900a2d0e86bc298551fb090a39e5cf42 (diff) | |
download | linux-517732c1b52b54824df68bb72b4030065e1aad47.tar.xz |
ALSA: hda: Balance runtime/system PM if direct-complete is disabled
[ Upstream commit 2b73649cee65b8e33c75c66348cb1bfe0ff9d766 ]
After hibernation, HDA controller can't be runtime-suspended after
commit 215a22ed31a1 ("ALSA: hda: Refactor codjc PM to use
direct-complete optimization"), which enables direct-complete for HDA
codec.
The HDA codec driver didn't expect direct-complete will be disabled
after it returns a positive value from prepare() callback. However,
there are some places that PM core can disable direct-complete. For
instance, system hibernation or when codec has subordinates like LEDs.
So if the codec is prepared for direct-complete but PM core still calls
codec's suspend or freeze callback, partially revert the commit and take
the original approach, which uses pm_runtime_force_*() helpers to
ensure PM refcount are balanced. Meanwhile, still keep prepare() and
complete() callbacks to enable direct-complete and request a resume for
jack detection, respectively.
Reported-by: Kenneth R. Crudup <kenny@panix.com>
Fixes: 215a22ed31a1 ("ALSA: hda: Refactor codec PM to use direct-complete optimization")
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Link: https://lore.kernel.org/r/20210119152145.346558-1-kai.heng.feng@canonical.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net')
0 files changed, 0 insertions, 0 deletions