* [patch] can't switch to jiffies clocksource
@ 2009-05-21 5:34 Luming Yu
0 siblings, 0 replies; only message in thread
From: Luming Yu @ 2009-05-21 5:34 UTC (permalink / raw)
To: LKML
[-- Attachment #1: Type: text/plain, Size: 1151 bytes --]
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@intel.com>
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 #2: 1.patch --]
[-- Type: application/octet-stream, Size: 524 bytes --]
diff --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;
}
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-05-21 5:42 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-21 5:34 [patch] can't switch to jiffies clocksource Luming Yu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®