[kernel] r15823 - in dists/sid/linux-2.6/debian: . patches/bugfix/sh4 patches/series
Aurelien Jarno
aurel32 at alioth.debian.org
Wed Jun 2 09:11:11 UTC 2010
Author: aurel32
Date: Wed Jun 2 09:10:51 2010
New Revision: 15823
Log:
* [sh4] fix sh_tmu clocksource following recent nohz changes.
Added:
dists/sid/linux-2.6/debian/patches/bugfix/sh4/
dists/sid/linux-2.6/debian/patches/bugfix/sh4/fix-sh_tmu.patch
Modified:
dists/sid/linux-2.6/debian/changelog
dists/sid/linux-2.6/debian/patches/series/16
Modified: dists/sid/linux-2.6/debian/changelog
==============================================================================
--- dists/sid/linux-2.6/debian/changelog Wed Jun 2 03:03:01 2010 (r15822)
+++ dists/sid/linux-2.6/debian/changelog Wed Jun 2 09:10:51 2010 (r15823)
@@ -7,6 +7,9 @@
[ Ben Hutchings ]
* Add stable 2.6.32.15
+ [ Aurelien Jarno ]
+ * [sh4] fix sh_tmu clocksource following recent nohz changes.
+
-- dann frazier <dannf at debian.org> Tue, 01 Jun 2010 09:23:57 -0600
linux-2.6 (2.6.32-15) unstable; urgency=low
Added: dists/sid/linux-2.6/debian/patches/bugfix/sh4/fix-sh_tmu.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/sid/linux-2.6/debian/patches/bugfix/sh4/fix-sh_tmu.patch Wed Jun 2 09:10:51 2010 (r15823)
@@ -0,0 +1,59 @@
+From: Aurelien Jarno <aurelien at aurel32.net>
+Date: Mon, 31 May 2010 21:45:48 +0000 (+0000)
+Subject: clocksource: sh_tmu: compute mult and shift before registration
+
+clocksource: sh_tmu: compute mult and shift before registration
+
+Since commit 98962465ed9e6ea99c38e0af63fe1dcb5a79dc25 ("nohz: Prevent
+clocksource wrapping during idle"), the CPU of an R2D board never goes
+to idle. This commit assumes that mult and shift are assigned before
+the clocksource is registered. As a consequence the safe maximum sleep
+time is negative and the CPU never goes into idle.
+
+This patch fixes the problem by moving mult and shift initialization
+from sh_tmu_clocksource_enable() to sh_tmu_register_clocksource().
+
+Signed-off-by: Aurelien Jarno <aurelien at aurel32.net>
+Cc: stable at kernel.org
+Signed-off-by: Paul Mundt <lethal at linux-sh.org>
+---
+
+diff --git a/drivers/clocksource/sh_tmu.c b/drivers/clocksource/sh_tmu.c
+index 8e44e14..de71590 100644
+--- a/drivers/clocksource/sh_tmu.c
++++ b/drivers/clocksource/sh_tmu.c
+@@ -199,16 +199,8 @@ static cycle_t sh_tmu_clocksource_read(struct clocksource *cs)
+ static int sh_tmu_clocksource_enable(struct clocksource *cs)
+ {
+ struct sh_tmu_priv *p = cs_to_sh_tmu(cs);
+- int ret;
+-
+- ret = sh_tmu_enable(p);
+- if (ret)
+- return ret;
+
+- /* TODO: calculate good shift from rate and counter bit width */
+- cs->shift = 10;
+- cs->mult = clocksource_hz2mult(p->rate, cs->shift);
+- return 0;
++ return sh_tmu_enable(p);
+ }
+
+ static void sh_tmu_clocksource_disable(struct clocksource *cs)
+@@ -228,6 +220,16 @@
+ cs->disable = sh_tmu_clocksource_disable;
+ cs->mask = CLOCKSOURCE_MASK(32);
+ cs->flags = CLOCK_SOURCE_IS_CONTINUOUS;
++
++ /* clk_get_rate() needs an enabled clock */
++ clk_enable(p->clk);
++ /* channel will be configured at parent clock / 4 */
++ p->rate = clk_get_rate(p->clk) / 4;
++ clk_disable(p->clk);
++ /* TODO: calculate good shift from rate and counter bit width */
++ cs->shift = 10;
++ cs->mult = clocksource_hz2mult(p->rate, cs->shift);
++
+ pr_info("sh_tmu: %s used as clock source\n", cs->name);
+ clocksource_register(cs);
+ return 0;
Modified: dists/sid/linux-2.6/debian/patches/series/16
==============================================================================
--- dists/sid/linux-2.6/debian/patches/series/16 Wed Jun 2 03:03:01 2010 (r15822)
+++ dists/sid/linux-2.6/debian/patches/series/16 Wed Jun 2 09:10:51 2010 (r15823)
@@ -1,3 +1,4 @@
+ bugfix/parisc/clear-fp-exception-flag-on-SIGFPE.patch
- bugfix/all/revert-percpu-stable-changes-2.patch
+ bugfix/all/stable/2.6.32.15.patch
++ bugfix/sh4/fix-sh_tmu.patch
More information about the Kernel-svn-changes
mailing list