From: Michael Trimarchi <trimarchimichael@yahoo.it>
To: linux-kernel@vger.kernel.org
Cc: joel.becker@oracle.com
Subject: [PATCH] Hangcheck-timer TSC source is stable?
Date: Wed, 17 Sep 2008 09:42:58 +0000 (GMT) [thread overview]
Message-ID: <157995.81345.qm@web26203.mail.ukl.yahoo.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 296 bytes --]
Hi,
This patch checks the TSC source before initialization.
Regards Michael
__________________________________________________
Do You Yahoo!?
Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi
http://mail.yahoo.it
[-- Attachment #2: hangcheck-timer-tsc-unstable.pach --]
[-- Type: application/octet-stream, Size: 1622 bytes --]
Check if the TSC source is stable otherwise fail registration.
Signed-off-by: Michael Trimarchi <trimarchimichael@yahoo.it>
---
drivers/char/hangcheck-timer.c | 15 +++++++++++----
1 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/drivers/char/hangcheck-timer.c b/drivers/char/hangcheck-timer.c
index 712d9f2..6b61389 100644
--- a/drivers/char/hangcheck-timer.c
+++ b/drivers/char/hangcheck-timer.c
@@ -175,12 +175,19 @@ static void hangcheck_fire(unsigned long data)
static int __init hangcheck_init(void)
{
- printk("Hangcheck: starting hangcheck timer %s (tick is %d seconds, margin is %d seconds).\n",
+ printk(KERN_INFO "Hangcheck: starting hangcheck timer %s"
+ " (tick is %d seconds, margin is %d seconds).\n",
VERSION_STR, hangcheck_tick, hangcheck_margin);
#if defined (HAVE_MONOTONIC)
- printk("Hangcheck: Using monotonic_clock().\n");
+ printk(KERN_INFO "Hangcheck: Using monotonic_clock().\n");
#else
- printk("Hangcheck: Using get_cycles().\n");
+ if (!check_tsc_unstable())
+ printk(KERN_INFO "Hangcheck: Using get_cycles().\n");
+ else {
+ printk(KERN_ERR "Handcheck: Failed to register"
+ " (Unstable TSC).\n");
+ return -ENODEV;
+ }
#endif /* HAVE_MONOTONIC */
hangcheck_tsc_margin =
(unsigned long long)(hangcheck_margin + hangcheck_tick);
@@ -196,7 +203,7 @@ static int __init hangcheck_init(void)
static void __exit hangcheck_exit(void)
{
del_timer_sync(&hangcheck_ticktock);
- printk("Hangcheck: Stopped hangcheck timer.\n");
+ printk(KERN_INFO "Hangcheck: Stopped hangcheck timer.\n");
}
module_init(hangcheck_init);
--
1.5.4.3
reply other threads:[~2008-09-17 9:43 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=157995.81345.qm@web26203.mail.ukl.yahoo.com \
--to=trimarchimichael@yahoo.it \
--cc=joel.becker@oracle.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®