Skip to content

Commit 16cdc62

Browse files
committed
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: Jason Wessel <jason.wessel@windriver.com>
1 parent fad99fa commit 16cdc62

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

kernel/debug/debug_core.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,12 @@ static void dbg_cpu_switch(int cpu, int next_cpu)
470470
kgdb_info[next_cpu].exception_state |= DCPU_NEXT_MASTER;
471471
}
472472

473+
static void dbg_touch_watchdogs(void)
474+
{
475+
touch_softlockup_watchdog_sync();
476+
clocksource_touch_watchdog();
477+
}
478+
473479
static int kgdb_cpu_enter(struct kgdb_state *ks, struct pt_regs *regs)
474480
{
475481
unsigned long flags;
@@ -523,8 +529,7 @@ static int kgdb_cpu_enter(struct kgdb_state *ks, struct pt_regs *regs)
523529
if (trace_on)
524530
tracing_on();
525531
atomic_dec(&cpu_in_kgdb[cpu]);
526-
touch_softlockup_watchdog_sync();
527-
clocksource_touch_watchdog();
532+
dbg_touch_watchdogs();
528533
local_irq_restore(flags);
529534
return 0;
530535
}
@@ -541,8 +546,7 @@ static int kgdb_cpu_enter(struct kgdb_state *ks, struct pt_regs *regs)
541546
(kgdb_info[cpu].task &&
542547
kgdb_info[cpu].task->pid != kgdb_sstep_pid) && --sstep_tries) {
543548
atomic_set(&kgdb_active, -1);
544-
touch_softlockup_watchdog_sync();
545-
clocksource_touch_watchdog();
549+
dbg_touch_watchdogs();
546550
local_irq_restore(flags);
547551

548552
goto acquirelock;
@@ -659,8 +663,7 @@ static int kgdb_cpu_enter(struct kgdb_state *ks, struct pt_regs *regs)
659663
tracing_on();
660664
/* Free kgdb_active */
661665
atomic_set(&kgdb_active, -1);
662-
touch_softlockup_watchdog_sync();
663-
clocksource_touch_watchdog();
666+
dbg_touch_watchdogs();
664667
local_irq_restore(flags);
665668

666669
return kgdb_info[cpu].ret_state;

0 commit comments

Comments
 (0)