linux/sound/pci
Lukas Wunner 009f8c90f5 ALSA: hda - Fix runtime PM
Before commit 3b5b899ca6 ("ALSA: hda: Make use of core codec functions
to sync power state"), hda_set_power_state() returned the response to
the Get Power State verb, a 32-bit unsigned integer whose expected value
is 0x233 after transitioning a codec to D3, and 0x0 after transitioning
it to D0.

The response value is significant because hda_codec_runtime_suspend()
does not clear the codec's bit in the codec_powered bitmask unless the
AC_PWRST_CLK_STOP_OK bit (0x200) is set in the response value.  That in
turn prevents the HDA controller from runtime suspending because
azx_runtime_idle() checks that the codec_powered bitmask is zero.

Since commit 3b5b899ca6, hda_set_power_state() only returns 0x0 or
0x1, thereby breaking runtime PM for any HDA controller.  That's because
an inline function introduced by the commit returns a bool instead of a
32-bit unsigned int.  The change was likely erroneous and resulted from
copying and pasting snd_hda_check_power_state(), which is immediately
preceding the newly introduced inline function.  Fix it.

Link: https://bugs.freedesktop.org/show_bug.cgi?id=106597
Fixes: 3b5b899ca6 ("ALSA: hda: Make use of core codec functions to sync power state")
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: Abhijeet Kumar <abhijeet.kumar@intel.com>
Reported-and-tested-by: Gunnar Krüger <taijian@posteo.de>
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-24 20:16:47 +02:00
..
ac97
ali5451
asihpi ALSA: asihpi: Hardening for potential Spectre v1 2018-04-25 10:37:47 +02:00
au88x0 ASoC: Updates for v4.15 2017-11-13 15:45:57 +01:00
aw2
ca0106
cs46xx
cs5535audio License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ctxfi ASoC: Updates for v4.15 2017-11-13 15:45:57 +01:00
echoaudio ALSA: echoaudio: remove redundant initialization of pointer 'pipe' 2018-03-12 16:05:11 +01:00
emu10k1 ALSA: emu10k1: add a IOMMU workaround 2018-02-14 07:46:55 +01:00
hda ALSA: hda - Fix runtime PM 2018-05-24 20:16:47 +02:00
ice1712 ALSA: ice1712: replace strcpy() with strlcpy() 2018-03-01 16:13:13 +01:00
korg1212 ALSA: korg1212: Delete a duplicate function call "release_firmware" in snd_korg1212_create() 2017-11-29 09:29:41 +01:00
lola
lx6464es
mixart
nm256 License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
oxygen ASoC: Updates for v4.15 2017-11-13 15:45:57 +01:00
pcxhr
riptide
rme9652 ALSA: rme9652: Hardening for potential Spectre v1 2018-04-25 10:37:48 +02:00
trident
vx222
ymfpci
ad1889.c
ad1889.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ak4531_codec.c
als300.c
als4000.c
atiixp_modem.c
atiixp.c
azt3328.c
azt3328.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
bt87x.c
cmipci.c
cs4281.c
cs5530.c
ens1370.c ALSA: ens137x: remove redundant variable result 2017-10-16 13:36:24 +02:00
ens1371.c
es1938.c
es1968.c
fm801.c
intel8x0.c
intel8x0m.c
Kconfig
maestro3.c
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
rme32.c
rme96.c
sis7019.c
sis7019.h
sonicvibes.c
via82xx_modem.c
via82xx.c