mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-12-04 01:36:58 -05:00
serial: msm_serial: disable interrupts in __msm_console_write()
[ Upstream commit aabdbb1b7a5819e18c403334a31fb0cc2c06ad41 ] __msm_console_write() assumes that interrupts are disabled, but with threaded console printers it is possible that the write() callback of the console is called with interrupts enabled. Explicitly disable interrupts using local_irq_save() to preserve the assumed context. Reported-by: Marek Szyprowski <[email protected]> Reviewed-by: Petr Mladek <[email protected]> Signed-off-by: John Ogness <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
This commit is contained in:
parent
52a0d88c32
commit
19f4b51b83
1 changed files with 5 additions and 0 deletions
|
|
@ -1579,6 +1579,7 @@ static inline struct uart_port *msm_get_port_from_line(unsigned int line)
|
|||
static void __msm_console_write(struct uart_port *port, const char *s,
|
||||
unsigned int count, bool is_uartdm)
|
||||
{
|
||||
unsigned long flags;
|
||||
int i;
|
||||
int num_newlines = 0;
|
||||
bool replaced = false;
|
||||
|
|
@ -1596,6 +1597,8 @@ static void __msm_console_write(struct uart_port *port, const char *s,
|
|||
num_newlines++;
|
||||
count += num_newlines;
|
||||
|
||||
local_irq_save(flags);
|
||||
|
||||
if (port->sysrq)
|
||||
locked = 0;
|
||||
else if (oops_in_progress)
|
||||
|
|
@ -1641,6 +1644,8 @@ static void __msm_console_write(struct uart_port *port, const char *s,
|
|||
|
||||
if (locked)
|
||||
spin_unlock(&port->lock);
|
||||
|
||||
local_irq_restore(flags);
|
||||
}
|
||||
|
||||
static void msm_console_write(struct console *co, const char *s,
|
||||
|
|
|
|||
Loading…
Reference in a new issue