All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] clk: qcom: clk-krait: fix wrong div2 functions
@ 2022-11-08 21:56 Christian Marangi
  2022-12-02 20:58 ` Bjorn Andersson
  0 siblings, 1 reply; 2+ messages in thread
From: Christian Marangi @ 2022-11-08 21:56 UTC (permalink / raw)
  To: Bjorn Andersson, Andy Gross, Konrad Dybcio, Michael Turquette,
	Stephen Boyd, Sricharan R, linux-arm-msm, linux-clk,
	linux-kernel
  Cc: Christian Marangi

Currently div2 value is applied to the wrong bits. This is caused by a
bug in the code where the shift is done only for lpl, for anything
else the mask is not shifted to the correct bits.

Fix this by correctly shift if lpl is not supported.

Fixes: 4d7dc77babfe ("clk: qcom: Add support for Krait clocks")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
---
 drivers/clk/qcom/clk-krait.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/clk/qcom/clk-krait.c b/drivers/clk/qcom/clk-krait.c
index 45da736bd5f4..293a9dfa7151 100644
--- a/drivers/clk/qcom/clk-krait.c
+++ b/drivers/clk/qcom/clk-krait.c
@@ -114,6 +114,8 @@ static int krait_div2_set_rate(struct clk_hw *hw, unsigned long rate,
 
 	if (d->lpl)
 		mask = mask << (d->shift + LPL_SHIFT) | mask << d->shift;
+	else
+		mask <<= d->shift;
 
 	spin_lock_irqsave(&krait_clock_reg_lock, flags);
 	val = krait_get_l2_indirect_reg(d->offset);
-- 
2.37.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] clk: qcom: clk-krait: fix wrong div2 functions
  2022-11-08 21:56 [PATCH] clk: qcom: clk-krait: fix wrong div2 functions Christian Marangi
@ 2022-12-02 20:58 ` Bjorn Andersson
  0 siblings, 0 replies; 2+ messages in thread
From: Bjorn Andersson @ 2022-12-02 20:58 UTC (permalink / raw)
  To: konrad.dybcio, sboyd, linux-arm-msm, mturquette, agross,
	sricharan, linux-kernel, Christian Marangi, linux-clk

On Tue, 8 Nov 2022 22:56:25 +0100, Christian Marangi wrote:
> Currently div2 value is applied to the wrong bits. This is caused by a
> bug in the code where the shift is done only for lpl, for anything
> else the mask is not shifted to the correct bits.
> 
> Fix this by correctly shift if lpl is not supported.
> 
> 
> [...]

Applied, thanks!

[1/1] clk: qcom: clk-krait: fix wrong div2 functions
      commit: d676d3a3717cf726d3affedbe5ba98fc4ccad7b3

Best regards,
-- 
Bjorn Andersson <andersson@kernel.org>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-12-02 20:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-08 21:56 [PATCH] clk: qcom: clk-krait: fix wrong div2 functions Christian Marangi
2022-12-02 20:58 ` Bjorn Andersson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.