fiq_debugger: print log by console thread
authorHuibin Hong <huibin.hong@rock-chips.com>
Fri, 12 Aug 2016 03:19:48 +0000 (11:19 +0800)
committerHuang, Tao <huangtao@rock-chips.com>
Tue, 16 Aug 2016 05:59:23 +0000 (13:59 +0800)
Change-Id: Id664cdfe02f87b1f8bb37b9a4e3985c1eafef226
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
drivers/soc/rockchip/rk_fiq_debugger.c
drivers/staging/android/fiq_debugger/Kconfig
drivers/staging/android/fiq_debugger/fiq_debugger.c
drivers/staging/android/fiq_debugger/fiq_debugger.h

index 61a4ab600c633d6bdb0775ea75e536ba4b1ddbad..e6f960894b89e844a24cf48110f952f10312cc3c 100755 (executable)
@@ -239,9 +239,9 @@ static void console_write(struct platform_device *pdev, const char *s, unsigned
        } else {
                while (count--) {
                        if (*s == '\n') {
-                               kfifo_put(&fifo, &r);
+                               kfifo_put(&fifo, r);
                        }
-                       kfifo_put(&fifo, s++);
+                       kfifo_put(&fifo, *s++);
                }
                wake_up_process(t->console_task);
        }
index 60fc224d4efc7894058832c5447de957c1304415..097f53b450aa5c897658d3c7141640d92d7d6f7c 100644 (file)
@@ -56,3 +56,9 @@ config FIQ_WATCHDOG
        select FIQ_DEBUGGER
        select PSTORE_RAM
        default n
+
+config RK_CONSOLE_THREAD
+       bool "Console write by thread"
+       default n
+       help
+         Normal kernel printk will write out to UART by "kconsole" kthread
index b132cff14f01c8a3ca59271651269fac50c0faba..b1746502fe3065b7bfbc43b0e72b9ef43c8a498c 100644 (file)
@@ -811,6 +811,13 @@ static void fiq_debugger_console_write(struct console *co,
        if (!state->console_enable && !state->syslog_dumping)
                return;
 
+#ifdef CONFIG_RK_CONSOLE_THREAD
+       if (state->pdata->console_write) {
+               state->pdata->console_write(state->pdev, s, count);
+               return;
+       }
+#endif
+
        fiq_debugger_uart_enable(state);
        spin_lock_irqsave(&state->console_lock, flags);
        while (count--) {
index c9ec4f8db086f41fedba417820600d70c2edff26..caf75155110f4cf77ed3c37f5fd47cc8c96ae026 100644 (file)
@@ -59,6 +59,11 @@ struct fiq_debugger_pdata {
 
        void (*force_irq)(struct platform_device *pdev, unsigned int irq);
        void (*force_irq_ack)(struct platform_device *pdev, unsigned int irq);
+
+#ifdef CONFIG_RK_CONSOLE_THREAD
+       void (*console_write)(struct platform_device *pdev, const char *s,
+                             unsigned int count);
+#endif
 };
 
 #endif