提交 491a7a43 编写于 作者: R Rune Torgersen 提交者: Kumar Gala

cpm_uart: Fix cpm uart corruption with PREEMPT_RT

Fix CPM serial port corruption when running with CONFIG_PREEMPT_RT.
Userland usage of console, and kernel printf's were stepping on each others toes.
Also only take lock if not in an oops.
Signed-off-by: NRune Torgersen <runet@innovsys.com>
Signed-off-by: NKumar Gala <galak@kernel.crashing.org>
上级 0fe9b1ea
......@@ -969,6 +969,14 @@ static void cpm_uart_console_write(struct console *co, const char *s,
unsigned int i;
cbd_t __iomem *bdp, *bdbase;
unsigned char *cp;
unsigned long flags;
int nolock = oops_in_progress;
if (unlikely(nolock)) {
local_irq_save(flags);
} else {
spin_lock_irqsave(&pinfo->port.lock, flags);
}
/* Get the address of the host memory buffer.
*/
......@@ -1030,6 +1038,12 @@ static void cpm_uart_console_write(struct console *co, const char *s,
;
pinfo->tx_cur = bdp;
if (unlikely(nolock)) {
local_irq_restore(flags);
} else {
spin_unlock_irqrestore(&pinfo->port.lock, flags);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册