From: Jason Wessel <jason.wessel@windriver.com>
To: linux-kernel@vger.kernel.org
Cc: tglx@linutronix.de
Subject: [PATCH 2/21] KGDB: Add clocksource_touch_watchdog
Date: Mon, 15 Oct 2007 13:32:37 -0500 [thread overview]
Message-ID: <4713B245.5080403@windriver.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 57 bytes --]
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
[-- Attachment #2: clocksource_watchdog.patch --]
[-- Type: text/x-patch, Size: 2628 bytes --]
clocksource_watchdog.patch
From: Jason Wessel <jason.wessel@windriver.com>
CC: tglx@linutronix.de
Subject: [PATCH] Add clocksource_touch_watchdog
Add a call to the clocksource watchdog API for touching the watchdog
such that the watchdog does not trip on a context resume from a kernel
debugger.
Add in the hooks to KGDB to make use of the API.
Original implementation by Konstantin Baydarov <kbaidarov@ru.mvista.com>
Signed-off-by: Konstantin Baydarov <kbaidarov@ru.mvista.com>
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
---
include/linux/clocksource.h | 1 +
kernel/kgdb.c | 4 ++++
kernel/time/clocksource.c | 12 ++++++++++++
3 files changed, 17 insertions(+)
--- a/include/linux/clocksource.h
+++ b/include/linux/clocksource.h
@@ -218,6 +218,7 @@ extern int clocksource_register(struct c
extern struct clocksource* clocksource_get_next(void);
extern void clocksource_change_rating(struct clocksource *cs, int rating);
extern void clocksource_resume(void);
+extern void clocksource_touch_watchdog(void);
#ifdef CONFIG_GENERIC_TIME_VSYSCALL
extern void update_vsyscall(struct timespec *ts, struct clocksource *c);
--- a/kernel/kgdb.c
+++ b/kernel/kgdb.c
@@ -51,6 +51,7 @@
#include <linux/sched.h>
#include <linux/pid_namespace.h>
#include <asm/byteorder.h>
+#include <linux/clocksource.h>
extern int pid_max;
/* How many times to count all of the waiting CPUs */
@@ -662,6 +663,7 @@ static void kgdb_wait(struct pt_regs *re
/* Signal the master processor that we are done */
atomic_set(&procindebug[processor], 0);
spin_unlock(&slavecpulocks[processor]);
+ clocksource_touch_watchdog();
local_irq_restore(flags);
}
#endif
@@ -1002,6 +1004,7 @@ int kgdb_handle_exception(int ex_vector,
atomic_read(&cpu_doing_single_step) != procid) {
atomic_set(&debugger_active, 0);
atomic_set(&kgdb_sync, -1);
+ clocksource_touch_watchdog();
local_irq_restore(flags);
goto acquirelock;
}
@@ -1549,6 +1552,7 @@ default_handle:
/* Free debugger_active */
atomic_set(&debugger_active, 0);
atomic_set(&kgdb_sync, -1);
+ clocksource_touch_watchdog();
local_irq_restore(flags);
return error;
--- a/kernel/time/clocksource.c
+++ b/kernel/time/clocksource.c
@@ -226,6 +226,18 @@ void clocksource_resume(void)
}
/**
+ * clocksource_touch_watchdog - Update watchdog
+ *
+ * Update the watchdog after exception contexts such as kgdb so as not
+ * to incorrectly trip the watchdog.
+ *
+ */
+void clocksource_touch_watchdog(void)
+{
+ clocksource_resume_watchdog();
+}
+
+/**
* clocksource_get_next - Returns the selected clocksource
*
*/
reply other threads:[~2007-10-15 18:36 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=4713B245.5080403@windriver.com \
--to=jason.wessel@windriver.com \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@linutronix.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.