LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Joel Stanley <joel@jms.id.au>
To: Eddie James <eajames@linux.vnet.ibm.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-clk@vger.kernel.org,
	Michael Turquette <mturquette@baylibre.com>,
	sboyd@kernel.org, Lei YU <mine260309@gmail.com>,
	Ryan Chen <ryan_chen@aspeedtech.com>
Subject: Re: [PATCH v2 1/2] clk: aspeed: Fix is_enabled for certain clocks
Date: Tue, 13 Mar 2018 16:10:01 +1030	[thread overview]
Message-ID: <CACPK8Xcx4P2kF8ryg=-WgZjjkVo3uzv+G2JGPiZiU3UGWV+4yg@mail.gmail.com> (raw)
In-Reply-To: <1520542640-9185-2-git-send-email-eajames@linux.vnet.ibm.com>

On Fri, Mar 9, 2018 at 7:27 AM, Eddie James <eajames@linux.vnet.ibm.com> wrote:
> Some of the Aspeed clocks are disabled by setting the relevant bit in
> the "clock stop control" register to one, while others are disabled by
> setting their bit to zero. The driver already uses a flag per gate  to
> identify this behavior, but doesn't apply it in the clock is_enabled
> function.
>
> Use the existing gate flag to correctly return whether or not a clock
> is enabled in the aspeed_clk_is_enabled function.
>
> Signed-off-by: Eddie James <eajames@linux.vnet.ibm.com>

Fixes: 6671507f0fbd ("clk: aspeed: Handle inverse polarity of USB port
1 clock gate")

Reviewed-by: Joel Stanley <joel@jms.id.au>

Cheers,

Joel

> ---
>  drivers/clk/clk-aspeed.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/clk/clk-aspeed.c b/drivers/clk/clk-aspeed.c
> index 9f7f931..1687771 100644
> --- a/drivers/clk/clk-aspeed.c
> +++ b/drivers/clk/clk-aspeed.c
> @@ -259,11 +259,12 @@ static int aspeed_clk_is_enabled(struct clk_hw *hw)
>  {
>         struct aspeed_clk_gate *gate = to_aspeed_clk_gate(hw);
>         u32 clk = BIT(gate->clock_idx);
> +       u32 enval = (gate->flags & CLK_GATE_SET_TO_DISABLE) ? 0 : clk;
>         u32 reg;
>
>         regmap_read(gate->map, ASPEED_CLK_STOP_CTRL, &reg);
>
> -       return (reg & clk) ? 0 : 1;
> +       return ((reg & clk) == enval) ? 1 : 0;
>  }
>
>  static const struct clk_ops aspeed_clk_gate_ops = {
> --
> 1.8.3.1
>

  reply	other threads:[~2018-03-13  5:40 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-08 20:57 [PATCH v2 0/2] clk: aspeed: Fix is_enabled and prevent reset if clock enabled Eddie James
2018-03-08 20:57 ` [PATCH v2 1/2] clk: aspeed: Fix is_enabled for certain clocks Eddie James
2018-03-13  5:40   ` Joel Stanley [this message]
2018-03-15 18:14   ` Stephen Boyd
2018-03-08 20:57 ` [PATCH v2 2/2] clk: aspeed: Prevent reset if clock is enabled Eddie James
2018-03-09  3:23   ` Lei YU
     [not found]   ` <CAARXrtktSUMBuHUUjqTgrWNZaHVkOC9DUQEr4WKeGNz2z6WVdA@mail.gmail.com>
2018-03-09  5:02     ` Joel Stanley
2018-03-13  5:42   ` Joel Stanley
2018-03-15 18:14   ` Stephen Boyd
2018-03-10  0:41 ` [PATCH v2 0/2] clk: aspeed: Fix is_enabled and prevent reset if clock enabled Stephen Boyd
2018-03-14 19:11   ` Eddie James

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='CACPK8Xcx4P2kF8ryg=-WgZjjkVo3uzv+G2JGPiZiU3UGWV+4yg@mail.gmail.com' \
    --to=joel@jms.id.au \
    --cc=eajames@linux.vnet.ibm.com \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mine260309@gmail.com \
    --cc=mturquette@baylibre.com \
    --cc=ryan_chen@aspeedtech.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;
as well as URLs for NNTP newsgroup(s).