From: Cristian Ciocaltea cristian.ciocaltea@collabora.com
stable inclusion from stable-v6.6.2 commit e7ba68a6db8afb3f5a78ab83f73b12c8b64bd306 category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I8IW7G
Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=...
--------------------------------
[ Upstream commit 85a1bf86fac0c195929768b4e92c78cad107523b ]
According to the documentation, drivers are responsible for undoing at removal time all runtime PM changes done during probing.
Hence, add the missing calls to pm_runtime_dont_use_autosuspend(), which are necessary for undoing pm_runtime_use_autosuspend().
Fixes: 1873ebd30cc8 ("ALSA: hda: cs35l41: Support Hibernation during Suspend") Signed-off-by: Cristian Ciocaltea cristian.ciocaltea@collabora.com Reviewed-by: Takashi Iwai tiwai@suse.de Link: https://lore.kernel.org/r/20230907171010.1447274-11-cristian.ciocaltea@colla... Signed-off-by: Mark Brown broonie@kernel.org Signed-off-by: Sasha Levin sashal@kernel.org Signed-off-by: Zheng Zengkai zhengzengkai@huawei.com --- sound/pci/hda/cs35l41_hda.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/sound/pci/hda/cs35l41_hda.c b/sound/pci/hda/cs35l41_hda.c index ebf9ddbb2605..3c157b006a5a 100644 --- a/sound/pci/hda/cs35l41_hda.c +++ b/sound/pci/hda/cs35l41_hda.c @@ -1676,6 +1676,7 @@ int cs35l41_hda_probe(struct device *dev, const char *device_name, int id, int i return 0;
err_pm: + pm_runtime_dont_use_autosuspend(cs35l41->dev); pm_runtime_disable(cs35l41->dev); pm_runtime_put_noidle(cs35l41->dev);
@@ -1694,6 +1695,7 @@ void cs35l41_hda_remove(struct device *dev) struct cs35l41_hda *cs35l41 = dev_get_drvdata(dev);
pm_runtime_get_sync(cs35l41->dev); + pm_runtime_dont_use_autosuspend(cs35l41->dev); pm_runtime_disable(cs35l41->dev);
if (cs35l41->halo_initialized)