From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Yang Yingliang <yangyingliang@huawei.com>,
Hulk Robot <hulkci@huawei.com>,
Thierry Reding <treding@nvidia.com>,
Sasha Levin <sashal@kernel.org>,
linux-clk@vger.kernel.org, linux-tegra@vger.kernel.org
Subject: [PATCH AUTOSEL 5.13 070/189] clk: tegra: tegra124-emc: Fix clock imbalance in emc_set_timing()
Date: Tue, 6 Jul 2021 07:12:10 -0400 [thread overview]
Message-ID: <20210706111409.2058071-70-sashal@kernel.org> (raw)
In-Reply-To: <20210706111409.2058071-1-sashal@kernel.org>
From: Yang Yingliang <yangyingliang@huawei.com>
[ Upstream commit f13570e7e830ca4fbf4869015af8492b8918445e ]
After calling clk_prepare_enable(), clk_disable_unprepare() needs
be called when prepare_timing_change() failed.
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/clk/tegra/clk-tegra124-emc.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/clk/tegra/clk-tegra124-emc.c b/drivers/clk/tegra/clk-tegra124-emc.c
index bdf6f4a51617..74c1d894cca8 100644
--- a/drivers/clk/tegra/clk-tegra124-emc.c
+++ b/drivers/clk/tegra/clk-tegra124-emc.c
@@ -249,8 +249,10 @@ static int emc_set_timing(struct tegra_clk_emc *tegra,
div = timing->parent_rate / (timing->rate / 2) - 2;
err = tegra->prepare_timing_change(emc, timing->rate);
- if (err)
+ if (err) {
+ clk_disable_unprepare(timing->parent);
return err;
+ }
spin_lock_irqsave(tegra->lock, flags);
--
2.30.2
prev parent reply other threads:[~2021-07-06 11:16 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20210706111409.2058071-1-sashal@kernel.org>
2021-07-06 11:11 ` [PATCH AUTOSEL 5.13 018/189] clk: renesas: rcar-usb2-clock-sel: Fix error handling in .probe() Sasha Levin
2021-07-06 11:11 ` [PATCH AUTOSEL 5.13 049/189] clk: renesas: r8a77995: Add ZA2 clock Sasha Levin
2021-07-06 11:11 ` [PATCH AUTOSEL 5.13 059/189] clk: tegra: Fix refcounting of gate clocks Sasha Levin
2021-07-06 11:12 ` [PATCH AUTOSEL 5.13 060/189] clk: tegra: Ensure that PLLU configuration is applied properly Sasha Levin
2021-07-06 11:12 ` Sasha Levin [this message]
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=20210706111409.2058071-70-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=hulkci@huawei.com \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=treding@nvidia.com \
--cc=yangyingliang@huawei.com \
/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