linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: marex@denx.de (Marek Vasut)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] clk: mxs: Fix invalid 32-bit access to frac registers
Date: Sun, 21 Dec 2014 22:50:15 +0100	[thread overview]
Message-ID: <201412212250.16007.marex@denx.de> (raw)
In-Reply-To: <1419169599-24791-1-git-send-email-stefan.wahren@i2se.com>

On Sunday, December 21, 2014 at 02:46:39 PM, Stefan Wahren wrote:

Hi!

[...]

> diff --git a/drivers/clk/mxs/clk-ref.c b/drivers/clk/mxs/clk-ref.c
> index 4adeed6..bdecec1 100644
> --- a/drivers/clk/mxs/clk-ref.c
> +++ b/drivers/clk/mxs/clk-ref.c
> @@ -16,6 +16,8 @@
>  #include <linux/slab.h>
>  #include "clk.h"
> 
> +#define BF_CLKGATE	BIT(7)
> +
>  /**
>   * struct clk_ref - mxs reference clock
>   * @hw: clk_hw for the reference clock
> @@ -39,7 +41,7 @@ static int clk_ref_enable(struct clk_hw *hw)
>  {
>  	struct clk_ref *ref = to_clk_ref(hw);
> 
> -	writel_relaxed(1 << ((ref->idx + 1) * 8 - 1), ref->reg + CLR);
> +	writeb(BF_CLKGATE, ref->reg + ref->idx + CLR);

Should this be writeb_relaxed() maybe ?

>  	return 0;
>  }
> @@ -48,7 +50,7 @@ static void clk_ref_disable(struct clk_hw *hw)
>  {
>  	struct clk_ref *ref = to_clk_ref(hw);
> 
> -	writel_relaxed(1 << ((ref->idx + 1) * 8 - 1), ref->reg + SET);
> +	writeb(BF_CLKGATE, ref->reg + ref->idx + SET);

Same here and all around the place ?

Other than that, it looks pretty OK :)

Best regards,
Marek Vasut

  reply	other threads:[~2014-12-21 21:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-21 13:46 [PATCH] clk: mxs: Fix invalid 32-bit access to frac registers Stefan Wahren
2014-12-21 21:50 ` Marek Vasut [this message]
2014-12-22  0:30   ` Stefan Wahren

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=201412212250.16007.marex@denx.de \
    --to=marex@denx.de \
    --cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).