hsu: do not write to console when emmc_ipanic
authorLi, Ning <ning.li@intel.com>
Wed, 11 Apr 2012 08:30:40 +0000 (16:30 +0800)
committerbuildbot <buildbot@intel.com>
Mon, 16 Apr 2012 07:45:05 +0000 (00:45 -0700)
BZ: 30826

When emmc_ipanic happens, panic logs will be keeping output to
console for more than 15 senconds, then watchdog will be triggered.
This causes kernel unable to save the log to emmc. This patch fixes
this issue by stop writing logs to console when emmc_ipanic.

Change-Id: I1482c79116cad0c590ff64ef4c273a5dc3eba071
Signed-off-by: Li, Ning <ning.li@intel.com>
Reviewed-on: http://android.intel.com:8080/43066
Reviewed-by: Zhang, Shijie <shijie.zhang@intel.com>
Reviewed-by: Yang, Bin <bin.yang@intel.com>
Reviewed-by: Du, Alek <alek.du@intel.com>
Tested-by: Wang, Zhifeng <zhifeng.wang@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
drivers/tty/serial/mfd.c

index 9457589..1b96fd8 100644 (file)
@@ -1457,6 +1457,12 @@ static void serial_hsu_console_putchar(struct uart_port *port, int ch)
        struct uart_hsu_port *up =
                container_of(port, struct uart_hsu_port, port);
 
+#ifdef CONFIG_EMMC_IPANIC
+       static int oops_char_len;
+
+       if (oops_in_progress && oops_char_len++ > 2048)
+               return;
+#endif
        wait_for_xmitr(up);
        serial_out(up, UART_TX, ch);
 }