hc
2024-11-01 2f529f9b558ca1c1bd74be7437a84e4711743404
kernel/drivers/tty/serial/imx.c
....@@ -1998,24 +1998,11 @@
19981998 imx_uart_writel(sport, ch, URTX0);
19991999 }
20002000
2001
-/*
2002
- * Interrupts are disabled on entering
2003
- */
20042001 static void
2005
-imx_uart_console_write(struct console *co, const char *s, unsigned int count)
2002
+__imx_uart_console_write(struct imx_port *sport, const char *s, unsigned int count)
20062003 {
2007
- struct imx_port *sport = imx_uart_ports[co->index];
20082004 struct imx_port_ucrs old_ucr;
20092005 unsigned int ucr1;
2010
- unsigned long flags = 0;
2011
- int locked = 1;
2012
-
2013
- if (sport->port.sysrq)
2014
- locked = 0;
2015
- else if (oops_in_progress)
2016
- locked = spin_trylock_irqsave(&sport->port.lock, flags);
2017
- else
2018
- spin_lock_irqsave(&sport->port.lock, flags);
20192006
20202007 /*
20212008 * First, save UCR1/2/3 and then disable interrupts
....@@ -2041,10 +2028,40 @@
20412028 while (!(imx_uart_readl(sport, USR2) & USR2_TXDC));
20422029
20432030 imx_uart_ucrs_restore(sport, &old_ucr);
2031
+}
2032
+
2033
+/*
2034
+ * Interrupts are disabled on entering
2035
+ */
2036
+static void
2037
+imx_uart_console_write(struct console *co, const char *s, unsigned int count)
2038
+{
2039
+ struct imx_port *sport = imx_uart_ports[co->index];
2040
+ unsigned long flags;
2041
+ int locked = 1;
2042
+
2043
+ if (sport->port.sysrq)
2044
+ locked = 0;
2045
+ else if (oops_in_progress)
2046
+ locked = spin_trylock_irqsave(&sport->port.lock, flags);
2047
+ else
2048
+ spin_lock_irqsave(&sport->port.lock, flags);
2049
+
2050
+ __imx_uart_console_write(sport, s, count);
20442051
20452052 if (locked)
20462053 spin_unlock_irqrestore(&sport->port.lock, flags);
20472054 }
2055
+
2056
+#ifdef CONFIG_RAW_PRINTK
2057
+static void
2058
+imx_uart_console_write_raw(struct console *co, const char *s, unsigned int count)
2059
+{
2060
+ struct imx_port *sport = imx_uart_ports[co->index];
2061
+
2062
+ return __imx_uart_console_write(sport, s, count);
2063
+}
2064
+#endif
20482065
20492066 /*
20502067 * If the port was already initialised (eg, by a boot loader),
....@@ -2161,6 +2178,9 @@
21612178 static struct console imx_uart_console = {
21622179 .name = DEV_NAME,
21632180 .write = imx_uart_console_write,
2181
+#ifdef CONFIG_RAW_PRINTK
2182
+ .write_raw = imx_uart_console_write_raw,
2183
+#endif
21642184 .device = uart_console_device,
21652185 .setup = imx_uart_console_setup,
21662186 .flags = CON_PRINTBUFFER,