All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: linux-omap@vger.kernel.org
Subject: Re: clk: ti: Add support for FAPLL on dm816x
Date: Wed, 28 Jan 2015 08:46:57 -0800	[thread overview]
Message-ID: <20150128164657.GN28663@atomide.com> (raw)
In-Reply-To: <20150128110514.GA4656@mwanda>

* Dan Carpenter <dan.carpenter@oracle.com> [150128 03:08]:
> Hello Tony Lindgren,
> 
> The patch 163152cbbe32: "clk: ti: Add support for FAPLL on dm816x"
> from Jan 13, 2015, leads to the following static checker warning:
> 
> 	drivers/clk/ti/fapll.c:87 ti_fapll_enable()
> 	warn: double left shift '1 << (1 << (3))'
> 
> drivers/clk/ti/fapll.c
>     82  static int ti_fapll_enable(struct clk_hw *hw)
>     83  {
>     84          struct fapll_data *fd = to_fapll(hw);
>     85          u32 v = readl_relaxed(fd->base);
>     86  
>     87          v |= (1 << FAPLL_MAIN_PLLEN);
>                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 
> FAPLL_MAIN_PLLEN() is BIT(3).  It's possible that this code is correct
> as is, but as a complete outsider I think it's more likely that the
> code should be:
> 
> 		v |= FAPLL_MAIN_PLLEN;
> 
> 
>     88          writel_relaxed(v, fd->base);
>     89  
>     90          return 0;
>     91  }
>     92  
>     93  static void ti_fapll_disable(struct clk_hw *hw)
>     94  {
>     95          struct fapll_data *fd = to_fapll(hw);
>     96          u32 v = readl_relaxed(fd->base);
>     97  
>     98          v &= ~(1 << FAPLL_MAIN_PLLEN);
>                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> Same.
> 
>     99          writel_relaxed(v, fd->base);
>    100  }
>    101  
>    102  static int ti_fapll_is_enabled(struct clk_hw *hw)
>    103  {
>    104          struct fapll_data *fd = to_fapll(hw);
>    105          u32 v = readl_relaxed(fd->base);
>    106  
>    107          return v & (1 << FAPLL_MAIN_PLLEN);
>                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^
> Same.
> 
>    108  }

Thanks for catching that. Yes that's a bug, I've screwed up
while cleaning up and means the parent PLL will not get disabled
even if all the children are disabled.

Will send a fix shortly.

Regards,

Tony

           reply	other threads:[~2015-01-28 20:27 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20150128110514.GA4656@mwanda>]

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=20150128164657.GN28663@atomide.com \
    --to=tony@atomide.com \
    --cc=dan.carpenter@oracle.com \
    --cc=linux-omap@vger.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 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.