All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] clk: versatile: mask VCO bits before writing
@ 2016-02-03 13:47 Linus Walleij
  2016-02-10  8:23 ` Linus Walleij
  0 siblings, 1 reply; 3+ messages in thread
From: Linus Walleij @ 2016-02-03 13:47 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd; +Cc: linux-clk, Linus Walleij

The Versatile syscon ICST driver OR:s the bits into place but
forgets to mask the previous value, making the code only work
if the register is zero or giving haphazard results. Mask the
19 bits used by the Versatile syscon interface register.

Regression caused and now fixed by yours truly.

Cc: Michael Turquette <mturquette@baylibre.com>
Cc: Stephen Boyd <sboyd@codeaurora.org>
Cc: linux-clk@vger.kernel.org
Fixes: 179c8fb3c2a6 ("clk: versatile-icst: convert to use regmap")
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/clk/versatile/clk-icst.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/clk/versatile/clk-icst.c b/drivers/clk/versatile/clk-icst.c
index e62f8cb2c9b5..3bca438ecd19 100644
--- a/drivers/clk/versatile/clk-icst.c
+++ b/drivers/clk/versatile/clk-icst.c
@@ -78,6 +78,9 @@ static int vco_set(struct clk_icst *icst, struct icst_vco vco)
 	ret = regmap_read(icst->map, icst->vcoreg_off, &val);
 	if (ret)
 		return ret;
+
+	/* Mask the 18 bits used by the VCO */
+	val &= ~0x7ffff;
 	val |= vco.v | (vco.r << 9) | (vco.s << 16);
 
 	/* This magic unlocks the VCO so it can be controlled */
-- 
2.4.3

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

* Re: [PATCH] clk: versatile: mask VCO bits before writing
  2016-02-03 13:47 [PATCH] clk: versatile: mask VCO bits before writing Linus Walleij
@ 2016-02-10  8:23 ` Linus Walleij
  2016-02-10 17:56   ` Stephen Boyd
  0 siblings, 1 reply; 3+ messages in thread
From: Linus Walleij @ 2016-02-10  8:23 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd; +Cc: linux-clk, Linus Walleij

On Wed, Feb 3, 2016 at 2:47 PM, Linus Walleij <linus.walleij@linaro.org> wrote:

> The Versatile syscon ICST driver OR:s the bits into place but
> forgets to mask the previous value, making the code only work
> if the register is zero or giving haphazard results. Mask the
> 19 bits used by the Versatile syscon interface register.
>
> Regression caused and now fixed by yours truly.
>
> Cc: Michael Turquette <mturquette@baylibre.com>
> Cc: Stephen Boyd <sboyd@codeaurora.org>
> Cc: linux-clk@vger.kernel.org
> Fixes: 179c8fb3c2a6 ("clk: versatile-icst: convert to use regmap")
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

Mike/Stephen, are you picking this for fixes?

Yours,
Linus Walleij

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

* Re: [PATCH] clk: versatile: mask VCO bits before writing
  2016-02-10  8:23 ` Linus Walleij
@ 2016-02-10 17:56   ` Stephen Boyd
  0 siblings, 0 replies; 3+ messages in thread
From: Stephen Boyd @ 2016-02-10 17:56 UTC (permalink / raw)
  To: Linus Walleij; +Cc: Michael Turquette, linux-clk

On 02/10, Linus Walleij wrote:
> On Wed, Feb 3, 2016 at 2:47 PM, Linus Walleij <linus.walleij@linaro.org> wrote:
> 
> > The Versatile syscon ICST driver OR:s the bits into place but
> > forgets to mask the previous value, making the code only work
> > if the register is zero or giving haphazard results. Mask the
> > 19 bits used by the Versatile syscon interface register.
> >
> > Regression caused and now fixed by yours truly.
> >
> > Cc: Michael Turquette <mturquette@baylibre.com>
> > Cc: Stephen Boyd <sboyd@codeaurora.org>
> > Cc: linux-clk@vger.kernel.org
> > Fixes: 179c8fb3c2a6 ("clk: versatile-icst: convert to use regmap")
> > Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> 
> Mike/Stephen, are you picking this for fixes?
> 

Thanks, I missed this one. Applied to clk-fixes.

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

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

end of thread, other threads:[~2016-02-10 17:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-03 13:47 [PATCH] clk: versatile: mask VCO bits before writing Linus Walleij
2016-02-10  8:23 ` Linus Walleij
2016-02-10 17:56   ` Stephen Boyd

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.