Commit 16cdc628 authored by Jason Wessel's avatar Jason Wessel

debug_core: move all watch dog syncs to a single function

Move the various clock and watch dog syncs to a single function in
advance of adding another sync for the rcu stall detector.
Signed-off-by: default avatarJason Wessel <jason.wessel@windriver.com>
parent fad99fac
...@@ -470,6 +470,12 @@ static void dbg_cpu_switch(int cpu, int next_cpu) ...@@ -470,6 +470,12 @@ static void dbg_cpu_switch(int cpu, int next_cpu)
kgdb_info[next_cpu].exception_state |= DCPU_NEXT_MASTER; kgdb_info[next_cpu].exception_state |= DCPU_NEXT_MASTER;
} }
static void dbg_touch_watchdogs(void)
{
touch_softlockup_watchdog_sync();
clocksource_touch_watchdog();
}
static int kgdb_cpu_enter(struct kgdb_state *ks, struct pt_regs *regs) static int kgdb_cpu_enter(struct kgdb_state *ks, struct pt_regs *regs)
{ {
unsigned long flags; unsigned long flags;
...@@ -523,8 +529,7 @@ static int kgdb_cpu_enter(struct kgdb_state *ks, struct pt_regs *regs) ...@@ -523,8 +529,7 @@ static int kgdb_cpu_enter(struct kgdb_state *ks, struct pt_regs *regs)
if (trace_on) if (trace_on)
tracing_on(); tracing_on();
atomic_dec(&cpu_in_kgdb[cpu]); atomic_dec(&cpu_in_kgdb[cpu]);
touch_softlockup_watchdog_sync(); dbg_touch_watchdogs();
clocksource_touch_watchdog();
local_irq_restore(flags); local_irq_restore(flags);
return 0; return 0;
} }
...@@ -541,8 +546,7 @@ static int kgdb_cpu_enter(struct kgdb_state *ks, struct pt_regs *regs) ...@@ -541,8 +546,7 @@ static int kgdb_cpu_enter(struct kgdb_state *ks, struct pt_regs *regs)
(kgdb_info[cpu].task && (kgdb_info[cpu].task &&
kgdb_info[cpu].task->pid != kgdb_sstep_pid) && --sstep_tries) { kgdb_info[cpu].task->pid != kgdb_sstep_pid) && --sstep_tries) {
atomic_set(&kgdb_active, -1); atomic_set(&kgdb_active, -1);
touch_softlockup_watchdog_sync(); dbg_touch_watchdogs();
clocksource_touch_watchdog();
local_irq_restore(flags); local_irq_restore(flags);
goto acquirelock; goto acquirelock;
...@@ -659,8 +663,7 @@ static int kgdb_cpu_enter(struct kgdb_state *ks, struct pt_regs *regs) ...@@ -659,8 +663,7 @@ static int kgdb_cpu_enter(struct kgdb_state *ks, struct pt_regs *regs)
tracing_on(); tracing_on();
/* Free kgdb_active */ /* Free kgdb_active */
atomic_set(&kgdb_active, -1); atomic_set(&kgdb_active, -1);
touch_softlockup_watchdog_sync(); dbg_touch_watchdogs();
clocksource_touch_watchdog();
local_irq_restore(flags); local_irq_restore(flags);
return kgdb_info[cpu].ret_state; return kgdb_info[cpu].ret_state;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment