From: Luming Yu <luming.yu@gmail.com>
To: LKML <linux-kernel@vger.kernel.org>
Subject: [patch] can't switch to jiffies clocksource
Date: Thu, 21 May 2009 13:34:33 +0800 [thread overview]
Message-ID: <3877989d0905202234o24b973a8ge8a074ea79ccac51@mail.gmail.com> (raw)
[-- 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;
}
}
reply other threads:[~2009-05-21 5:42 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=3877989d0905202234o24b973a8ge8a074ea79ccac51@mail.gmail.com \
--to=luming.yu@gmail.com \
--cc=linux-kernel@vger.kernel.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
all inboxes | Powered by JetHome®