linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: marek.vasut@gmail.com (Marek Vasut)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/3] pxa2xx/cpufreq: Simplify DRI recomputation routine
Date: Mon, 28 Jun 2010 14:04:56 +0200	[thread overview]
Message-ID: <201006281404.56236.marek.vasut@gmail.com> (raw)
In-Reply-To: <AANLkTilIQOmzV5JNk63dQvCViFjYOASLuZ39AZKykf6Z@mail.gmail.com>

Dne Po 28. ?ervna 2010 06:38:16 Eric Miao napsal(a):
> On Thu, Jun 24, 2010 at 9:57 PM, Marek Vasut <marek.vasut@gmail.com> wrote:
> > This patch:
> > 1) Simpifies the DRI recomputation routine by pulling out the common code
> > 2) Fixes a bug in PXA27x DRI recomputation caused by incorrect
> > parenthesis
> > 
> > Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
> 
> Good catch, I've modified it a bit so it's more compact and reable below
> and I'll apply this to the 'fix' branch.

Ewww ... I'm kind-of missing the readability now ;-)

But I guess if you look into it for a long enough time, it's ok.

Acked-by: Marek Vasut <marek.vasut@gmail.com>

> 
> diff --git a/arch/arm/mach-pxa/cpufreq-pxa2xx.c
> b/arch/arm/mach-pxa/cpufreq-pxa2xx.c
> index 9e4d981..268a9bc 100644
> --- a/arch/arm/mach-pxa/cpufreq-pxa2xx.c
> +++ b/arch/arm/mach-pxa/cpufreq-pxa2xx.c
> @@ -256,13 +256,9 @@ static void init_sdram_rows(void)
> 
>  static u32 mdrefr_dri(unsigned int freq)
>  {
> -       u32 dri = 0;
> +       u32 interval = freq * SDRAM_TREF / sdram_rows;
> 
> -       if (cpu_is_pxa25x())
> -               dri = ((freq * SDRAM_TREF) / (sdram_rows * 32));
> -       if (cpu_is_pxa27x())
> -               dri = ((freq * SDRAM_TREF) / (sdram_rows - 31)) / 32;
> -       return dri;
> +       return (interval - (cpu_is_pxa27x() ? 31 : 0)) / 32;
>  }
> 
>  /* find a valid frequency point */
> 
> > ---
> >  arch/arm/mach-pxa/cpufreq-pxa2xx.c |    9 +++++----
> >  1 files changed, 5 insertions(+), 4 deletions(-)
> > 
> > diff --git a/arch/arm/mach-pxa/cpufreq-pxa2xx.c
> > b/arch/arm/mach-pxa/cpufreq-pxa2xx.c index 9e4d981..bb5f21e 100644
> > --- a/arch/arm/mach-pxa/cpufreq-pxa2xx.c
> > +++ b/arch/arm/mach-pxa/cpufreq-pxa2xx.c
> > @@ -256,12 +256,13 @@ static void init_sdram_rows(void)
> > 
> >  static u32 mdrefr_dri(unsigned int freq)
> >  {
> > -       u32 dri = 0;
> > +       u32 dri = freq * SDRAM_TREF / sdram_rows;
> > 
> > -       if (cpu_is_pxa25x())
> > -               dri = ((freq * SDRAM_TREF) / (sdram_rows * 32));
> >        if (cpu_is_pxa27x())
> > -               dri = ((freq * SDRAM_TREF) / (sdram_rows - 31)) / 32;
> > +               dri -= 31;
> > +
> > +       dri /= 32;
> > +
> >        return dri;
> >  }
> > 
> > --
> > 1.7.1

  reply	other threads:[~2010-06-28 12:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-24 13:57 [PATCH 1/3] pxa3xx: Fix HSIO bus x24 multiplier Marek Vasut
2010-06-24 13:57 ` [PATCH 2/3] pxa2xx/cpufreq: Simplify DRI recomputation routine Marek Vasut
2010-06-28  4:38   ` Eric Miao
2010-06-28 12:04     ` Marek Vasut [this message]
2010-06-24 13:57 ` [PATCH 3/3] pxa2xx/cpufreq: Fix PCMCIA frequency scaling Marek Vasut
2010-06-28  4:53   ` Eric Miao
2010-06-28  3:56 ` [PATCH 1/3] pxa3xx: Fix HSIO bus x24 multiplier Eric Miao

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=201006281404.56236.marek.vasut@gmail.com \
    --to=marek.vasut@gmail.com \
    --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).