From 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e Mon Sep 17 00:00:00 2001 From: hc <hc@nodka.com> Date: Mon, 13 May 2024 10:30:14 +0000 Subject: [PATCH] modify sin led gpio --- kernel/drivers/soc/rockchip/fiq_debugger/rk_fiq_debugger.c | 25 +++++++++++++++++-------- 1 files changed, 17 insertions(+), 8 deletions(-) diff --git a/kernel/drivers/soc/rockchip/fiq_debugger/rk_fiq_debugger.c b/kernel/drivers/soc/rockchip/fiq_debugger/rk_fiq_debugger.c index 3c85c83..6dafdde 100644 --- a/kernel/drivers/soc/rockchip/fiq_debugger/rk_fiq_debugger.c +++ b/kernel/drivers/soc/rockchip/fiq_debugger/rk_fiq_debugger.c @@ -179,11 +179,13 @@ if (lsr & UART_LSR_DR) { temp = rk_fiq_read(t, UART_RX); - buf[n & 0x1f] = temp; - n++; - if (temp == 'q' && n > 2) { - if ((buf[(n - 2) & 0x1f] == 'i') && - (buf[(n - 3) & 0x1f] == 'f')) + buf[++n & 0x1f] = temp; + + if (temp == 'q') { + if ((buf[(n - 1) & 0x1f] == 'i') && + (buf[(n - 2) & 0x1f] == 'f') && + (buf[(n - 3) & 0x1f] != '_') && + (buf[(n - 3) & 0x1f] != ' ')) return FIQ_DEBUGGER_BREAK; else return temp; @@ -334,7 +336,7 @@ unsigned int dropped; set_current_state(TASK_INTERRUPTIBLE); - if (kfifo_is_empty(&fifo) && kfifo_is_empty(&tty_fifo)) { + if (console_thread_stop || (kfifo_is_empty(&fifo) && kfifo_is_empty(&tty_fifo))) { smp_store_mb(console_thread_running, false); schedule(); smp_store_mb(console_thread_running, true); @@ -344,13 +346,13 @@ set_current_state(TASK_RUNNING); while (!console_thread_stop && (!kfifo_is_empty(&fifo) || !kfifo_is_empty(&tty_fifo))) { - while (kfifo_get(&fifo, &c)) { + while (!console_thread_stop && kfifo_get(&fifo, &c)) { console_put(pdev, &c, 1); if (c == '\n') break; } - while (kfifo_get(&tty_fifo, &c)) { + while (!console_thread_stop && kfifo_get(&tty_fifo, &c)) { console_putc(pdev, c); len_tty++; if (c == '\n') @@ -418,6 +420,8 @@ unsigned int ret = 0; struct rk_fiq_debugger *t; + if (console_thread_stop) + return count; t = container_of(dev_get_platdata(&pdev->dev), typeof(*t), pdata); if (count > 0) { @@ -759,6 +763,11 @@ if ((sip_fiq_debugger_is_enabled()) && (sip_fiq_debugger_get_target_cpu() == cpu)) { target_cpu = cpumask_any_but(cpu_online_mask, cpu); + if (target_cpu >= nr_cpu_ids) { + pr_err("%s: migrate fiq fail!\n", __func__); + return -EBUSY; + } + sip_fiq_debugger_switch_cpu(target_cpu); } -- Gitblit v1.6.2