Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

slimbus: qcom-ngd-ctrl: drop PM runtime counter on transfer error paths

If transfer in qcom_slim_ngd_xfer_msg_sync() fails, we need to drop the
PM runtime usage counter to have it balanced.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20221118065246.6835-3-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Krzysztof Kozlowski and committed by
Greg Kroah-Hartman
63c60a22 97e1a530

+11 -3
+11 -3
drivers/slimbus/qcom-ngd-ctrl.c
··· 919 919 DECLARE_COMPLETION_ONSTACK(done); 920 920 int ret, timeout; 921 921 922 - pm_runtime_get_sync(ctrl->dev); 922 + ret = pm_runtime_get_sync(ctrl->dev); 923 + if (ret < 0) 924 + goto pm_put; 923 925 924 926 txn->comp = &done; 925 927 926 928 ret = qcom_slim_ngd_xfer_msg(ctrl, txn); 927 929 if (ret) 928 - return ret; 930 + goto pm_put; 929 931 930 932 timeout = wait_for_completion_timeout(&done, HZ); 931 933 if (!timeout) { 932 934 dev_err(ctrl->dev, "TX timed out:MC:0x%x,mt:0x%x", txn->mc, 933 935 txn->mt); 934 - return -ETIMEDOUT; 936 + ret = -ETIMEDOUT; 937 + goto pm_put; 935 938 } 936 939 return 0; 940 + 941 + pm_put: 942 + pm_runtime_put(ctrl->dev); 943 + 944 + return ret; 937 945 } 938 946 939 947 static int qcom_slim_ngd_enable_stream(struct slim_stream_runtime *rt)