linux-stable/sound/pci/hda
Kai-Heng Feng 2b73649cee ALSA: hda: Balance runtime/system PM if direct-complete is disabled
After hibernation, HDA controller can't be runtime-suspended after
commit 215a22ed31 ("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: 215a22ed31 ("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>
2021-01-19 16:42:39 +01:00
..
ca0132_regs.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 32 2019-05-24 17:27:10 +02:00
hda_auto_parser.c ALSA: hda: auto_parser: remove shadowed variable declaration 2020-09-03 09:27:00 +02:00
hda_auto_parser.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 46 2019-05-24 17:27:12 +02:00
hda_beep.c ALSA: Use fallthrough pseudo-keyword 2020-07-09 13:01:29 +02:00
hda_beep.h ALSA: hda - Use standard device registration for beep 2019-01-29 18:28:09 +01:00
hda_bind.c ALSA: hda - Fix pending unsol events at shutdown 2019-10-28 12:44:28 +01:00
hda_codec.c ALSA: hda: Balance runtime/system PM if direct-complete is disabled 2021-01-19 16:42:39 +01:00
hda_controller.c ALSA: hda: Enable sync-write operation as default for all controllers 2020-06-19 12:05:02 +02:00
hda_controller.h ALSA: hda: Separate runtime and system suspend 2020-10-28 09:43:08 +01:00
hda_controller_trace.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
hda_eld.c ALSA: hda: Use scnprintf() for printing texts for sysfs/procfs 2020-02-18 10:15:41 +01:00
hda_generic.c ALSA: hda/generic: Add option to enforce preferred_dacs pairs 2020-11-28 09:29:52 +01:00
hda_generic.h ALSA: hda/generic: Add option to enforce preferred_dacs pairs 2020-11-28 09:29:52 +01:00
hda_hwdep.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 32 2019-05-24 17:27:10 +02:00
hda_intel.c ALSA: hda: Add Cometlake-R PCI ID 2021-01-15 11:15:53 +01:00
hda_intel.h ALSA: hda: Release resources at error in delayed probe 2020-04-13 18:02:36 +02:00
hda_intel_trace.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
hda_jack.c ALSA: hda - Fix the return value if cb func is already registered 2020-10-22 08:17:02 +02:00
hda_jack.h ALSA: hda: (cosmetic) align function parameters 2020-09-03 09:27:11 +02:00
hda_local.h ALSA: hda: (cosmetic) align function parameters 2020-09-03 09:27:11 +02:00
hda_proc.c ALSA: hda/proc - print DP-MST connections 2020-12-08 20:04:33 +01:00
hda_sysfs.c ALSA: hda: Fix regressions on clear and reconfig sysfs 2020-12-10 19:55:35 +01:00
hda_tegra.c ALSA: hda/tegra: fix tegra-hda on tegra30 soc 2021-01-12 14:44:47 +01:00
hp_x360_helper.c ALSA: hda/realtek - Fixup for HP x360 laptops with B&O speakers 2018-05-29 22:33:37 +02:00
Kconfig ALSA: hda/hdmi: Add Intel silent stream support 2020-07-07 12:42:35 +02:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
patch_analog.c ALSA: hda/analog - Minor optimization for SPDIF mux connections 2020-01-16 17:29:17 +01:00
patch_ca0110.c ALSA: hda: Unify get_response handling 2019-12-13 14:36:52 +01:00
patch_ca0132.c ALSA: hda/ca0132 - Add ZxR surround DAC setup. 2020-12-12 11:09:52 +01:00
patch_cirrus.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 32 2019-05-24 17:27:10 +02:00
patch_cmedia.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 32 2019-05-24 17:27:10 +02:00
patch_conexant.c ALSA: hda/conexant: add a new hda codec CX11970 2020-12-31 11:40:21 +01:00
patch_hdmi.c ALSA: hda: Add AlderLake-P PCI ID and HDMI codec vid 2021-01-13 17:02:43 +01:00
patch_realtek.c ALSA: hda/realtek - Limit int mic boost on Acer Aspire E5-575T 2021-01-14 12:58:02 +01:00
patch_si3054.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 32 2019-05-24 17:27:10 +02:00
patch_sigmatel.c ALSA: pci: delete repeated words in comments 2020-08-06 09:30:02 +02:00
patch_via.c ALSA: hda/via: Add minimum mute flag 2021-01-14 15:11:15 +01:00
thinkpad_helper.c ALSA: hda/realtek: Use the new vmaster mute LED helper 2020-06-18 13:23:49 +02:00