linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: tony@atomide.com (Tony Lindgren)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2a/5] Remove unsafe clock values from omap1_defconfig
Date: Thu, 1 Dec 2011 11:04:55 -0800	[thread overview]
Message-ID: <20111201190455.GV31337@atomide.com> (raw)
In-Reply-To: <201112011938.36706.jkrzyszt@tis.icnet.pl>

* Janusz Krzysztofik <jkrzyszt@tis.icnet.pl> [111201 10:04]:
> On Thursday 01 of December 2011 at 18:17:58, Tony Lindgren wrote:
> > 
> > --- a/arch/arm/mach-omap1/clock_data.c
> > +++ b/arch/arm/mach-omap1/clock_data.c
> > @@ -927,7 +927,7 @@ int __init omap1_clk_init(void)
> >  
> >  void __init omap1_clk_late_init(void)
> >  {
> > -	if (ck_dpll1.rate >= OMAP1_DPLL1_SANE_VALUE)
> > +	if (ck_dpll1.rate > OMAP1_DPLL1_SANE_VALUE)
> >  		return;
> >  
> >  	/* Find the highest supported frequency and enable it */
> 
> This change really makes sense to me, however, knowing the initial 
> (bootloader selected) clock rate my board boots at, which is 
> unfortunately raw 12 MHz, I would be surprised if that helped.

OK, that's not it then. BTW, we should be able to drop that test once
we have your patches applied.
 
> Before e9b7086b80c4d9e354f4edc9e280ae85a60df408, 
> omap1_select_table_rate() was returning the rate selected with .config 
> because it was called early, with ck_dpll1_p->rate uninitialized. Now it 
> is not, and returns nothing, resulting in 60 MHz default. Then, the only 
> way I can see to correct the problem is something like patch 3/5, which 
> you are justifiably affraid of of always switching to 216 MHz with 
> omap1_defconfig.

Ah, you got it! That's what causes the regression. How about the following
fix for the -rc cycle then?

Tony


From: Tony Lindgren <tony@atomide.com>
Date: Thu, 1 Dec 2011 11:00:11 -0800
Subject: [PATCH] ARM: OMAP1: Fix reprogramming of DPLL1 for systems that boot at rates below 60MHz

Commit e9b7086b80c4d9e354f4edc9e280ae85a60df408 (ARM: OMAP: Fix
reprogramming of dpll1 rate) fixed a regression for systems that
did not rely on bootloader set rates.

However, it also introduced a new problem where the rates selected
in .config would not take affect as omap1_select_table_rate
currently refuses to reprogram DPLL1 if it's already initialized.

This was not a problem earlier, as the reprogramming was done
earlier with ck_dpll1_p->rate uninitialized.

Fix this by forcing the reprogramming on systems booting at rates
below 60MHz. Note that the long term fix is to make the rates
SoC specific later on.

Thanks for Janusz Krzysztofik <jkrzyszt@tis.icnet.pl> for figuring
this one out.

Reported-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Signed-off-by: Tony Lindgren <tony@atomide.com>

diff --git a/arch/arm/mach-omap1/clock_data.c b/arch/arm/mach-omap1/clock_data.c
index 1297bb5..3f30561 100644
--- a/arch/arm/mach-omap1/clock_data.c
+++ b/arch/arm/mach-omap1/clock_data.c
@@ -930,6 +930,9 @@ void __init omap1_clk_late_init(void)
 	if (ck_dpll1.rate >= OMAP1_DPLL1_SANE_VALUE)
 		return;
 
+	/* System booting at unusable rate, force reprogramming of DPLL1 */
+	ck_dpll1_p->rate = 0;
+
 	/* Find the highest supported frequency and enable it */
 	if (omap1_select_table_rate(&virtual_ck_mpu, ~0)) {
 		pr_err("System frequencies not set, using default. Check your config.\n");

  reply	other threads:[~2011-12-01 19:04 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-27  3:32 [PATCH 0/5] ARM: OMAP1: Fix dpll1 reprogramming related issues Janusz Krzysztofik
2011-11-27  3:32 ` [PATCH 1/5] ARM: OMAP1: Fix dpll1 default rate reprogramming method Janusz Krzysztofik
2011-11-28 17:45   ` Tony Lindgren
2011-11-28 22:00     ` [PATCH 2a/5] Remove unsafe clock values from omap1_defconfig Janusz Krzysztofik
2011-11-30 22:32       ` Tony Lindgren
2011-11-30 20:57     ` [PATCH 2a/5 v2] ARM: OMAP1: select clock rate by CPU type Janusz Krzysztofik
2011-11-30 22:28       ` Tony Lindgren
2011-12-01 10:10         ` Janusz Krzysztofik
2011-12-01 18:22           ` Tony Lindgren
2011-12-01 18:54             ` Janusz Krzysztofik
2011-12-01 19:06               ` Tony Lindgren
2011-12-04 12:17         ` [PATCH] ARM: OMAP1: Move dpll1 rates selection from config to runtime Janusz Krzysztofik
2011-12-08 23:13           ` Janusz Krzysztofik
2011-12-09  1:51             ` [PATCH v2] " Janusz Krzysztofik
2011-12-09  2:09               ` Tony Lindgren
2011-12-09  2:31                 ` Janusz Krzysztofik
2011-12-09  1:51       ` [PATCH] ARM: OMAP1: Set the omap1623 sram size to 16K Tony Lindgren
     [not found]     ` <201112010310.43890.jkrzyszt@tis.icnet.pl>
     [not found]       ` <20111201022750.GY13928@atomide.com>
2011-12-01  9:54         ` [PATCH 2a/5] Remove unsafe clock values from omap1_defconfig Janusz Krzysztofik
2011-12-01 10:21           ` Janusz Krzysztofik
2011-12-01 17:17           ` Tony Lindgren
2011-12-01 18:38             ` Janusz Krzysztofik
2011-12-01 19:04               ` Tony Lindgren [this message]
2011-12-01 19:23                 ` Janusz Krzysztofik
2011-12-01 19:46                   ` Tony Lindgren
2011-12-01 20:30                     ` [PATCH] ARM: OMAP1: " Janusz Krzysztofik
2011-12-01 20:13                   ` [PATCH 0/2 v2] ARM: OMAP1: Fix dpll1 reprogramming related issues Janusz Krzysztofik
2011-12-01 21:16                     ` [PATCH v2] ARM: OMAP1: Update dpll1 default rate reprogramming method Janusz Krzysztofik
2011-12-02  2:09                     ` [PATCH 0/2 v2] ARM: OMAP1: Fix dpll1 reprogramming related issues Tony Lindgren
2011-12-02 17:02                       ` Janusz Krzysztofik
2011-12-01 20:13                   ` [PATCH 1/2 v2] ARM: OMAP1: Fix ckctl value used for dpll1 defualt rate Janusz Krzysztofik
2011-12-01 20:13                   ` [PATCH 2/2 v2] ARM: OMAP1: recalculate loops per jiffy after dpll1 reprogram Janusz Krzysztofik
2011-12-04 15:07                 ` [PATCH] ARM: OMAP1: Always reprogramme dpll1 rate at boot Janusz Krzysztofik
2011-11-27  3:32 ` [PATCH 2/5] ARM: OMAP1: Fix ckctl value used for dpll1 defualt rate Janusz Krzysztofik
2011-11-27  3:32 ` [PATCH 3/5] ARM: OMAP1: Fix dpll1 reprogramming not actually allowed Janusz Krzysztofik
2011-11-28 17:46   ` Tony Lindgren
2011-11-27  3:32 ` [PATCH 4/5] init/calibrate.c: allow for recalibration of loops per jiffy Janusz Krzysztofik
2011-11-28 15:39   ` Russell King - ARM Linux
2011-11-28 22:30     ` Janusz Krzysztofik
2011-11-27  3:32 ` [PATCH 5/5] ARM: OMAP1: recalibrate loops per jiffy after dpll1 reprogram Janusz Krzysztofik
2011-11-29  0:25   ` [PATCH 5/5 v2] ARM: OMAP1: recalculate " Janusz Krzysztofik
2011-12-09  8:42     ` Russell King - ARM Linux
2011-12-09 10:00       ` Janusz Krzysztofik
2011-12-09 10:09         ` Janusz Krzysztofik
2011-12-10  0:25         ` Russell King - ARM Linux
2011-12-10 12:04           ` Janusz Krzysztofik

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=20111201190455.GV31337@atomide.com \
    --to=tony@atomide.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).