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)
 {
        unsigned long flags;
                        if (trace_on)
                                tracing_on();
                        atomic_dec(&cpu_in_kgdb[cpu]);
-                       touch_softlockup_watchdog_sync();
-                       clocksource_touch_watchdog();
+                       dbg_touch_watchdogs();
                        local_irq_restore(flags);
                        return 0;
                }
            (kgdb_info[cpu].task &&
             kgdb_info[cpu].task->pid != kgdb_sstep_pid) && --sstep_tries) {
                atomic_set(&kgdb_active, -1);
-               touch_softlockup_watchdog_sync();
-               clocksource_touch_watchdog();
+               dbg_touch_watchdogs();
                local_irq_restore(flags);
 
                goto acquirelock;
                tracing_on();
        /* Free kgdb_active */
        atomic_set(&kgdb_active, -1);
-       touch_softlockup_watchdog_sync();
-       clocksource_touch_watchdog();
+       dbg_touch_watchdogs();
        local_irq_restore(flags);
 
        return kgdb_info[cpu].ret_state;