From: Kevin Hilman <khilman@deeprootsystems.com>
To: Tero Kristo <tero.kristo@nokia.com>
Cc: linux-omap@vger.kernel.org
Subject: Re: [PATCH] PM: Fix a bug with noncore dpll rate calculation
Date: Wed, 19 Nov 2008 09:32:28 -0800 [thread overview]
Message-ID: <87r657fwpf.fsf@deeprootsystems.com> (raw)
In-Reply-To: <1227086881-16261-1-git-send-email-tero.kristo@nokia.com> (Tero Kristo's message of "Wed\, 19 Nov 2008 11\:28\:01 +0200")
Tero Kristo <tero.kristo@nokia.com> writes:
> Noncore dpll can enter autoidle state, in which case the rate calculation
> fails. Fixed by checking dpll mode instead of idle status.
>
> Signed-off-by: Tero Kristo <tero.kristo@nokia.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
> ---
> arch/arm/mach-omap2/clock.c | 16 +++++++++++-----
> arch/arm/mach-omap2/cm-regbits-34xx.h | 2 ++
> 2 files changed, 13 insertions(+), 5 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c
> index 522ce6f..bbd3e82 100644
> --- a/arch/arm/mach-omap2/clock.c
> +++ b/arch/arm/mach-omap2/clock.c
> @@ -212,9 +212,16 @@ u32 omap2_get_dpll_rate(struct clk *clk)
> return 0;
>
> /* Return bypass rate if DPLL is bypassed */
> - v = cm_read_mod_reg(clk->prcm_mod, dd->idlest_reg);
> - v &= dd->idlest_mask;
> - v >>= __ffs(dd->idlest_mask);
> + if (cpu_is_omap34xx()) {
> + v = cm_read_mod_reg(clk->prcm_mod, dd->control_reg);
> + v &= dd->enable_mask;
> + v >>= __ffs(dd->enable_mask);
> + } else {
> + v = cm_read_mod_reg(clk->prcm_mod, dd->idlest_reg);
> + v &= dd->idlest_mask;
> + v >>= __ffs(dd->idlest_mask);
> + }
> +
> if (cpu_is_omap24xx()) {
>
> if (v == ST_CORE_CLK_REF)
> @@ -224,9 +231,8 @@ u32 omap2_get_dpll_rate(struct clk *clk)
>
> } else if (cpu_is_omap34xx()) {
>
> - if (!v)
> + if (v == OMAP3430_EN_MPU_DPLL_BYPASS)
> return dd->bypass_clk->rate;
> -
> }
>
> v = cm_read_mod_reg(clk->prcm_mod, dd->mult_div1_reg);
> diff --git a/arch/arm/mach-omap2/cm-regbits-34xx.h b/arch/arm/mach-omap2/cm-regbits-34xx.h
> index 6f3f5a3..9995353 100644
> --- a/arch/arm/mach-omap2/cm-regbits-34xx.h
> +++ b/arch/arm/mach-omap2/cm-regbits-34xx.h
> @@ -112,6 +112,8 @@
> #define OMAP3430_EN_MPU_DPLL_DRIFTGUARD_MASK (1 << 3)
> #define OMAP3430_EN_MPU_DPLL_SHIFT 0
> #define OMAP3430_EN_MPU_DPLL_MASK (0x7 << 0)
> +#define OMAP3430_EN_MPU_DPLL_LOCK (0x7 << 0)
> +#define OMAP3430_EN_MPU_DPLL_BYPASS (0x5 << 0)
>
> /* CM_IDLEST_MPU */
> #define OMAP3430_ST_MPU (1 << 0)
> --
> 1.5.4.3
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2008-11-19 17:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-19 9:28 [PATCH] PM: Fix a bug with noncore dpll rate calculation Tero Kristo
2008-11-19 17:32 ` Kevin Hilman [this message]
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=87r657fwpf.fsf@deeprootsystems.com \
--to=khilman@deeprootsystems.com \
--cc=linux-omap@vger.kernel.org \
--cc=tero.kristo@nokia.com \
/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