You need to sign in or sign up before continuing.
提交 ef49ffd8 编写于 作者: L Lionel Debieve 提交者: Greg Kroah-Hartman

tty: serial: st-asc: Make the locking RT aware

The lock is a sleeping lock and local_irq_save() is not the
standard implementation now. Working for both -RT and non
RT.
Signed-off-by: NLionel Debieve <lionel.debieve@st.com>
Acked-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
Acked-by: NPatrice Chotard <patrice.chotard@st.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 19fa6e60
...@@ -887,13 +887,12 @@ static void asc_console_write(struct console *co, const char *s, unsigned count) ...@@ -887,13 +887,12 @@ static void asc_console_write(struct console *co, const char *s, unsigned count)
int locked = 1; int locked = 1;
u32 intenable; u32 intenable;
local_irq_save(flags);
if (port->sysrq) if (port->sysrq)
locked = 0; /* asc_interrupt has already claimed the lock */ locked = 0; /* asc_interrupt has already claimed the lock */
else if (oops_in_progress) else if (oops_in_progress)
locked = spin_trylock(&port->lock); locked = spin_trylock_irqsave(&port->lock, flags);
else else
spin_lock(&port->lock); spin_lock_irqsave(&port->lock, flags);
/* /*
* Disable interrupts so we don't get the IRQ line bouncing * Disable interrupts so we don't get the IRQ line bouncing
...@@ -911,8 +910,7 @@ static void asc_console_write(struct console *co, const char *s, unsigned count) ...@@ -911,8 +910,7 @@ static void asc_console_write(struct console *co, const char *s, unsigned count)
asc_out(port, ASC_INTEN, intenable); asc_out(port, ASC_INTEN, intenable);
if (locked) if (locked)
spin_unlock(&port->lock); spin_unlock_irqrestore(&port->lock, flags);
local_irq_restore(flags);
} }
static int asc_console_setup(struct console *co, char *options) static int asc_console_setup(struct console *co, char *options)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册