mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [RESEND][PATCH] Fix oops on !GENERIC_TIME systems when accessing current_clocksource
@ 2010-03-01 20:34 john stultz
  2010-03-02  8:24 ` [tip:timers/urgent] timekeeping: Prevent oops when GENERIC_TIME=n tip-bot for john stultz
  2010-03-08 21:22 ` [RESEND][PATCH] Fix oops on !GENERIC_TIME systems when accessing current_clocksource john stultz
  0 siblings, 2 replies; 4+ messages in thread
From: john stultz @ 2010-03-01 20:34 UTC (permalink / raw)
  To: greg kh, Ingo Molnar, stable
  Cc: Thomas Gleixner, Martin Schwidefsky, aaro.koskinen, lkml

No one has replied to this, so I wanted to send it out again.

Aaro Koskinen reported an issue in bug #15366, where on non-GENERIC_TIME
systems,
accessing /sys/devices/system/clocksource/clocksource0/current_clocksource would oops the system. 

It seems the timekeeper/clocksource rework missed initializing the
curr_clocksource value in the !GENERIC_TIME.

The following patch makes sure it gets initialized, and avoids the
issue.

Thanks to Aaro for reporting and diagnosing the issue as well as testing
the fix!

Bug Details: http://bugzilla.kernel.org/show_bug.cgi?id=15366

Too late for 2.6.33, but this likely should go into 2.6.33-stable and
2.6.32-stable.

thanks
-john


Signed-off-by: John Stultz <johnstul@us.ibm.com>

diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c
index e85c234..c436ee5 100644
--- a/kernel/time/clocksource.c
+++ b/kernel/time/clocksource.c
@@ -568,6 +568,10 @@ static inline void clocksource_select(void) { }
  */
 static int __init clocksource_done_booting(void)
 {
+	mutex_lock(&clocksource_mutex);
+	curr_clocksource = clocksource_default_clock();
+	mutex_unlock(&clocksource_mutex);
+
 	finished_booting = 1;
 
 	/*




^ permalink raw reply	[flat|nested] 4+ messages in thread

* [tip:timers/urgent] timekeeping: Prevent oops when GENERIC_TIME=n
  2010-03-01 20:34 [RESEND][PATCH] Fix oops on !GENERIC_TIME systems when accessing current_clocksource john stultz
@ 2010-03-02  8:24 ` tip-bot for john stultz
  2010-03-08 21:22 ` [RESEND][PATCH] Fix oops on !GENERIC_TIME systems when accessing current_clocksource john stultz
  1 sibling, 0 replies; 4+ messages in thread
From: tip-bot for john stultz @ 2010-03-02  8:24 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, johnstul, schwidefsky, aaro.koskinen, tglx

Commit-ID:  ad6759fbf35d104dbf573cd6f4c6784ad6823f7e
Gitweb:     http://git.kernel.org/tip/ad6759fbf35d104dbf573cd6f4c6784ad6823f7e
Author:     john stultz <johnstul@us.ibm.com>
AuthorDate: Mon, 1 Mar 2010 12:34:43 -0800
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Tue, 2 Mar 2010 09:22:25 +0100

timekeeping: Prevent oops when GENERIC_TIME=n

Aaro Koskinen reported an issue in kernel.org bugzilla #15366, where
on non-GENERIC_TIME systems, accessing
/sys/devices/system/clocksource/clocksource0/current_clocksource
results in an oops.

It seems the timekeeper/clocksource rework missed initializing the
curr_clocksource value in the !GENERIC_TIME case.

Thanks to Aaro for reporting and diagnosing the issue as well as
testing the fix!

Reported-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: John Stultz <johnstul@us.ibm.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: stable@kernel.org
LKML-Reference: <1267475683.4216.61.camel@localhost.localdomain>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

---
 kernel/time/clocksource.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c
index 1f663d2..1f5dde6 100644
--- a/kernel/time/clocksource.c
+++ b/kernel/time/clocksource.c
@@ -592,6 +592,10 @@ static inline void clocksource_select(void) { }
  */
 static int __init clocksource_done_booting(void)
 {
+	mutex_lock(&clocksource_mutex);
+	curr_clocksource = clocksource_default_clock();
+	mutex_unlock(&clocksource_mutex);
+
 	finished_booting = 1;
 
 	/*

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RESEND][PATCH] Fix oops on !GENERIC_TIME systems when accessing current_clocksource
  2010-03-01 20:34 [RESEND][PATCH] Fix oops on !GENERIC_TIME systems when accessing current_clocksource john stultz
  2010-03-02  8:24 ` [tip:timers/urgent] timekeeping: Prevent oops when GENERIC_TIME=n tip-bot for john stultz
@ 2010-03-08 21:22 ` john stultz
  2010-03-08 21:33   ` Thomas Gleixner
  1 sibling, 1 reply; 4+ messages in thread
From: john stultz @ 2010-03-08 21:22 UTC (permalink / raw)
  To: greg kh
  Cc: Ingo Molnar, stable, Thomas Gleixner, Martin Schwidefsky,
	aaro.koskinen, lkml

On Mon, 2010-03-01 at 12:34 -0800, john stultz wrote:
> No one has replied to this, so I wanted to send it out again.

Just another ping here. I know the patch has made it to -tip, but its
something that should be needed for 2.6.34, 2.6.33-stable.

thanks
-john


> Aaro Koskinen reported an issue in bug #15366, where on non-GENERIC_TIME
> systems,
> accessing /sys/devices/system/clocksource/clocksource0/current_clocksource would oops the system. 
> 
> It seems the timekeeper/clocksource rework missed initializing the
> curr_clocksource value in the !GENERIC_TIME.
> 
> The following patch makes sure it gets initialized, and avoids the
> issue.
> 
> Thanks to Aaro for reporting and diagnosing the issue as well as testing
> the fix!
> 
> Bug Details: http://bugzilla.kernel.org/show_bug.cgi?id=15366
> 
> Too late for 2.6.33, but this likely should go into 2.6.33-stable and
> 2.6.32-stable.
> 
> thanks
> -john
> 
> 
> Signed-off-by: John Stultz <johnstul@us.ibm.com>
> 
> diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c
> index e85c234..c436ee5 100644
> --- a/kernel/time/clocksource.c
> +++ b/kernel/time/clocksource.c
> @@ -568,6 +568,10 @@ static inline void clocksource_select(void) { }
>   */
>  static int __init clocksource_done_booting(void)
>  {
> +	mutex_lock(&clocksource_mutex);
> +	curr_clocksource = clocksource_default_clock();
> +	mutex_unlock(&clocksource_mutex);
> +
>  	finished_booting = 1;
>  
>  	/*
> 
> 



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RESEND][PATCH] Fix oops on !GENERIC_TIME systems when accessing current_clocksource
  2010-03-08 21:22 ` [RESEND][PATCH] Fix oops on !GENERIC_TIME systems when accessing current_clocksource john stultz
@ 2010-03-08 21:33   ` Thomas Gleixner
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Gleixner @ 2010-03-08 21:33 UTC (permalink / raw)
  To: john stultz
  Cc: greg kh, Ingo Molnar, stable, Martin Schwidefsky, aaro.koskinen, lkml

On Mon, 8 Mar 2010, john stultz wrote:

> On Mon, 2010-03-01 at 12:34 -0800, john stultz wrote:
> > No one has replied to this, so I wanted to send it out again.
> 
> Just another ping here. I know the patch has made it to -tip, but its
> something that should be needed for 2.6.34, 2.6.33-stable.

I'm going to send a pull request tomorrow.

Thanks,

	tglx

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-03-08 21:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-01 20:34 [RESEND][PATCH] Fix oops on !GENERIC_TIME systems when accessing current_clocksource john stultz
2010-03-02  8:24 ` [tip:timers/urgent] timekeeping: Prevent oops when GENERIC_TIME=n tip-bot for john stultz
2010-03-08 21:22 ` [RESEND][PATCH] Fix oops on !GENERIC_TIME systems when accessing current_clocksource john stultz
2010-03-08 21:33   ` Thomas Gleixner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome