From: Johan Hovold <johan+linaro@kernel.org>
To: Bjorn Andersson <andersson@kernel.org>
Cc: Andy Gross <agross@kernel.org>,
Konrad Dybcio <konrad.dybcio@linaro.org>,
Michael Turquette <mturquette@baylibre.com>,
Stephen Boyd <sboyd@kernel.org>,
linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org,
linux-kernel@vger.kernel.org,
Johan Hovold <johan+linaro@kernel.org>
Subject: [PATCH 4/8] clk: qcom: gcc-sc8280xp: fix runtime PM imbalance on probe errors
Date: Tue, 18 Jul 2023 15:28:58 +0200 [thread overview]
Message-ID: <20230718132902.21430-5-johan+linaro@kernel.org> (raw)
In-Reply-To: <20230718132902.21430-1-johan+linaro@kernel.org>
Make sure to decrement the runtime PM usage count before returning in
case RCG dynamic frequency switch initialisation fails.
Fixes: 2a541abd9837 ("clk: qcom: gcc-sc8280xp: Add runtime PM")
Cc: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
---
drivers/clk/qcom/gcc-sc8280xp.c | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/drivers/clk/qcom/gcc-sc8280xp.c b/drivers/clk/qcom/gcc-sc8280xp.c
index 1fb6ffac730c..ac6f8c0c1ccb 100644
--- a/drivers/clk/qcom/gcc-sc8280xp.c
+++ b/drivers/clk/qcom/gcc-sc8280xp.c
@@ -7539,8 +7539,8 @@ static int gcc_sc8280xp_probe(struct platform_device *pdev)
regmap = qcom_cc_map(pdev, &gcc_sc8280xp_desc);
if (IS_ERR(regmap)) {
- pm_runtime_put(&pdev->dev);
- return PTR_ERR(regmap);
+ ret = PTR_ERR(regmap);
+ goto err_put_rpm;
}
/*
@@ -7561,11 +7561,19 @@ static int gcc_sc8280xp_probe(struct platform_device *pdev)
ret = qcom_cc_register_rcg_dfs(regmap, gcc_dfs_clocks, ARRAY_SIZE(gcc_dfs_clocks));
if (ret)
- return ret;
+ goto err_put_rpm;
ret = qcom_cc_really_probe(pdev, &gcc_sc8280xp_desc, regmap);
+ if (ret)
+ goto err_put_rpm;
+
pm_runtime_put(&pdev->dev);
+ return 0;
+
+err_put_rpm:
+ pm_runtime_put_sync(&pdev->dev);
+
return ret;
}
--
2.41.0
next prev parent reply other threads:[~2023-07-18 13:30 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-18 13:28 [PATCH 0/8] clk: qcom: fix runtime PM bugs Johan Hovold
2023-07-18 13:28 ` [PATCH 1/8] clk: qcom: camcc-sc7180: fix async resume during probe Johan Hovold
2023-07-18 13:28 ` [PATCH 2/8] clk: qcom: dispcc-sm8450: fix runtime PM imbalance on probe errors Johan Hovold
2023-07-18 13:28 ` [PATCH 3/8] clk: qcom: dispcc-sm8550: " Johan Hovold
2023-07-18 13:28 ` Johan Hovold [this message]
2023-07-19 7:09 ` [PATCH 4/8] clk: qcom: gcc-sc8280xp: " Johan Hovold
2023-07-18 13:28 ` [PATCH 5/8] clk: qcom: lpasscc-sc7280: fix missing resume during probe Johan Hovold
2023-07-18 14:58 ` Bjorn Andersson
2023-07-18 15:39 ` Johan Hovold
2023-07-18 13:29 ` [PATCH 6/8] clk: qcom: q6sstop-qcs404: " Johan Hovold
2023-07-18 13:29 ` [PATCH 7/8] clk: qcom: mss-sc7180: " Johan Hovold
2023-07-18 13:29 ` [PATCH 8/8] clk: qcom: turingcc-qcs404: " Johan Hovold
2023-07-18 13:46 ` [PATCH 0/8] clk: qcom: fix runtime PM bugs Konrad Dybcio
2023-07-19 7:23 ` Johan Hovold
2023-07-18 19:10 ` Bjorn Andersson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230718132902.21430-5-johan+linaro@kernel.org \
--to=johan+linaro@kernel.org \
--cc=agross@kernel.org \
--cc=andersson@kernel.org \
--cc=konrad.dybcio@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mturquette@baylibre.com \
--cc=sboyd@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox