fiq_debugger: Switch current cpu when the former cpu is offline
authorHuibin Hong <huibin.hong@rock-chips.com>
Thu, 19 Jan 2017 02:12:23 +0000 (10:12 +0800)
committerHuang, Tao <huangtao@rock-chips.com>
Fri, 20 Jan 2017 09:38:13 +0000 (17:38 +0800)
Change-Id: Ie1a5fe5c3496e5182f0f9aaab336a4d0ff683dfa
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
drivers/staging/android/fiq_debugger/fiq_debugger.c

index 8a63290e5a9f0e21fbfd893b23ea4f82a5e3e53b..c9a38705f3ad402c1ea576273ade1570205ca292 100644 (file)
@@ -647,7 +647,7 @@ static bool fiq_debugger_handle_uart_interrupt(struct fiq_debugger_state *state,
        int count = 0;
        bool signal_helper = false;
 
-       if (this_cpu != state->current_cpu) {
+       if ((this_cpu != state->current_cpu) && (cpu_online(state->current_cpu))) {
                if (state->in_fiq)
                        return false;
 
@@ -665,6 +665,9 @@ static bool fiq_debugger_handle_uart_interrupt(struct fiq_debugger_state *state,
                return false;
        }
 
+       if (this_cpu != state->current_cpu)
+               state->current_cpu = this_cpu;
+
        state->in_fiq = true;
 
        while ((c = fiq_debugger_getc(state)) != FIQ_DEBUGGER_NO_CHAR) {