Commit 7c3078b637882303b1dcf6a16229d0e35f6b60a5

Authored by Jason Wessel
Committed by Ingo Molnar
1 parent d359752407

kgdb: clocksource watchdog

In order to not trip the clocksource watchdog, kgdb must touch the
clocksource watchdog on the return to normal system run state.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>

Showing 3 changed files with 17 additions and 0 deletions Side-by-side Diff

include/linux/clocksource.h
... ... @@ -216,6 +216,7 @@
216 216 /* used to install a new clocksource */
217 217 extern int clocksource_register(struct clocksource*);
218 218 extern void clocksource_unregister(struct clocksource*);
  219 +extern void clocksource_touch_watchdog(void);
219 220 extern struct clocksource* clocksource_get_next(void);
220 221 extern void clocksource_change_rating(struct clocksource *cs, int rating);
221 222 extern void clocksource_resume(void);
... ... @@ -28,6 +28,7 @@
28 28 * kind, whether express or implied.
29 29 */
30 30 #include <linux/pid_namespace.h>
  31 +#include <linux/clocksource.h>
31 32 #include <linux/interrupt.h>
32 33 #include <linux/spinlock.h>
33 34 #include <linux/console.h>
... ... @@ -574,6 +575,7 @@
574 575  
575 576 /* Signal the primary CPU that we are done: */
576 577 atomic_set(&cpu_in_kgdb[cpu], 0);
  578 + clocksource_touch_watchdog();
577 579 local_irq_restore(flags);
578 580 }
579 581 #endif
... ... @@ -1396,6 +1398,7 @@
1396 1398 atomic_read(&kgdb_cpu_doing_single_step) != cpu) {
1397 1399  
1398 1400 atomic_set(&kgdb_active, -1);
  1401 + clocksource_touch_watchdog();
1399 1402 local_irq_restore(flags);
1400 1403  
1401 1404 goto acquirelock;
... ... @@ -1487,6 +1490,7 @@
1487 1490 kgdb_restore:
1488 1491 /* Free kgdb_active */
1489 1492 atomic_set(&kgdb_active, -1);
  1493 + clocksource_touch_watchdog();
1490 1494 local_irq_restore(flags);
1491 1495  
1492 1496 return error;
kernel/time/clocksource.c
... ... @@ -222,6 +222,18 @@
222 222 }
223 223  
224 224 /**
  225 + * clocksource_touch_watchdog - Update watchdog
  226 + *
  227 + * Update the watchdog after exception contexts such as kgdb so as not
  228 + * to incorrectly trip the watchdog.
  229 + *
  230 + */
  231 +void clocksource_touch_watchdog(void)
  232 +{
  233 + clocksource_resume_watchdog();
  234 +}
  235 +
  236 +/**
225 237 * clocksource_get_next - Returns the selected clocksource
226 238 *
227 239 */