ALSA: hda: fix a runtime pm issue in SOF when integrated GPU is disabled
PATCH 1/1 ALSA: hda: fix a runtime pm issue in SOF when integrated GPU is disabled
From: Rander Wang <[email protected]>
In snd_hdac_device_init pm_runtime_set_active is called to increase child_count in parent device. But when it is failed to build connection with GPU for one case that integrated graphic gpu is disabled, snd_hdac_ext_bus_device_exit will be invoked to clean up a HD-audio extended codec base device. At this time the child_count of parent is not decreased, which makes parent device can't get suspended.
This patch calls pm_runtime_set_suspended to decrease child_count in parent device in snd_hdac_device_exit to match with snd_hdac_device_init. pm_runtime_set_suspended can make sure that it will not decrease child_count if the device is already suspended.
--- sound/hda/hdac_device.c | 2 ++ 1 file changed, 2 insertions(+)
sound/hda/hdac_device.c +2 -0
@@ -127,6 +127,8 @@ EXPORT_SYMBOL_GPL(snd_hdac_device_init);void snd_hdac_device_exit (struct hdac_device *codec) {pm_runtime_put_noidle (&codec->dev); +/* keep balance of runtime PM child_count in parent device */ +pm_runtime_set_suspended (&codec->dev);snd_hdac_bus_remove_device (codec->bus, codec);kfree (codec->vendor_name);kfree (codec->chip_name);
Signature · 1 line
2.27.0
Quoted 16 lines · Kai Vehmanen
From: Rander Wang <[email protected]>
In
snd_hdac_device_initpm_runtime_set_activeis called to increasechild_countin parent device. But when it is failed to build connection with GPU for one case that integrated graphic gpu is disabled,snd_hdac_ext_bus_device_exitwill be invoked to clean up a HD-audio extended codec base device. At this time thechild_countof parent is not decreased, which makes parent device can't get suspended.This patch calls
pm_runtime_set_suspendedto decreasechild_countin parent device insnd_hdac_device_exitto match withsnd_hdac_device_init.pm_runtime_set_suspendedcan make sure that it will not decreasechild_countif the device is already suspended.
Quoted 6 lines
Signed-off-by Rander Wang <[email protected]>Reviewed-by Ranjani Sridharan <[email protected]>Reviewed-by Pierre-Louis Bossart <[email protected]>Reviewed-by Bard Liao <[email protected]>Reviewed-by Guennadi Liakhovetski <[email protected]>Signed-off-by Kai Vehmanen <[email protected]>
Applied now. Thanks.
Takashi