[patch] can't switch to jiffies clocksource

From: Luming Yu
Date: Thu May 21 2009 - 01:42:56 EST


Hello,

As this bug https://bugzilla.redhat.com/show_bug.cgi?id=496028,
echo jiffies > clocksource0/current_clocksource make system crash.
I reproduced the problem with upstream kernel.
The root cause is that jiffies is just a variable in memory,
it relies on other clock source to tick , and it never ticks on itself.

Please review, and apply.

**The patch is enclosed in text attachment*
**Using web client to send the patch* *
**below is for review, please apply attached patch*/

Thanks,
Luming


Signed-off-by: Yu Luming <luming.yu@xxxxxxxxx>

clocksource.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)


iff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c
index ecfd7b5..bdffe43 100644
--- a/kernel/time/clocksource.c
+++ b/kernel/time/clocksource.c
@@ -507,8 +507,9 @@ static ssize_t sysfs_override_clocksource(struct
sys_device *dev,
/* try to select it: */
list_for_each_entry(cs, &clocksource_list, list) {
if (strlen(cs->name) == len &&
- !strcmp(cs->name, override_name))
- ovr = cs;
+ !strcmp(cs->name, override_name) &&
+ cs != &clocksource_jiffies)
+ ovr = cs;
}
}

Attachment: 1.patch
Description: Binary data