This is a note to let you know that I've just added the patch titled ASoC: codecs: wcd938x-sdw: fix runtime PM imbalance on probe errors to the 6.1-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: asoc-codecs-wcd938x-sdw-fix-runtime-pm-imbalance-on-probe-errors.patch and it can be found in the queue-6.1 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From c5c0383082eace13da2ffceeea154db2780165e7 Mon Sep 17 00:00:00 2001 From: Johan Hovold <johan+linaro@xxxxxxxxxx> Date: Tue, 3 Oct 2023 17:55:58 +0200 Subject: ASoC: codecs: wcd938x-sdw: fix runtime PM imbalance on probe errors From: Johan Hovold <johan+linaro@xxxxxxxxxx> commit c5c0383082eace13da2ffceeea154db2780165e7 upstream. Make sure to balance the runtime PM operations, including the disable count, on probe errors and on driver unbind. Fixes: 16572522aece ("ASoC: codecs: wcd938x-sdw: add SoundWire driver") Cc: stable@xxxxxxxxxxxxxxx # 5.14 Cc: Srinivas Kandagatla <srinivas.kandagatla@xxxxxxxxxx> Signed-off-by: Johan Hovold <johan+linaro@xxxxxxxxxx> Link: https://lore.kernel.org/r/20231003155558.27079-8-johan+linaro@xxxxxxxxxx Signed-off-by: Mark Brown <broonie@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- sound/soc/codecs/wcd938x-sdw.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) --- a/sound/soc/codecs/wcd938x-sdw.c +++ b/sound/soc/codecs/wcd938x-sdw.c @@ -1278,7 +1278,18 @@ static int wcd9380_probe(struct sdw_slav pm_runtime_set_active(dev); pm_runtime_enable(dev); - return component_add(dev, &wcd938x_sdw_component_ops); + ret = component_add(dev, &wcd938x_sdw_component_ops); + if (ret) + goto err_disable_rpm; + + return 0; + +err_disable_rpm: + pm_runtime_disable(dev); + pm_runtime_set_suspended(dev); + pm_runtime_dont_use_autosuspend(dev); + + return ret; } static int wcd9380_remove(struct sdw_slave *pdev) @@ -1287,6 +1298,10 @@ static int wcd9380_remove(struct sdw_sla component_del(dev, &wcd938x_sdw_component_ops); + pm_runtime_disable(dev); + pm_runtime_set_suspended(dev); + pm_runtime_dont_use_autosuspend(dev); + return 0; } Patches currently in stable-queue which might be from johan+linaro@xxxxxxxxxx are queue-6.1/asoc-codecs-wcd938x-fix-unbind-tear-down-order.patch queue-6.1/asoc-codecs-wcd938x-sdw-fix-use-after-free-on-driver-unbind.patch queue-6.1/asoc-codecs-wcd938x-drop-bogus-bind-error-handling.patch queue-6.1/asoc-codecs-wcd938x-fix-resource-leaks-on-bind-errors.patch queue-6.1/asoc-codecs-wcd938x-sdw-fix-runtime-pm-imbalance-on-probe-errors.patch queue-6.1/regmap-fix-null-deref-on-lookup.patch