lkml.org 
[lkml]   [2015]   [Dec]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] serial: earlycon: Initialize uart_port spinlock
Date
Initialize the uart_port spinlock of earlycon to avoid the BUG() when
booting with spinlock debug enabled.

Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
---
drivers/tty/serial/earlycon.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/tty/serial/earlycon.c b/drivers/tty/serial/earlycon.c
index f09636083426..6c18891ad8d0 100644
--- a/drivers/tty/serial/earlycon.c
+++ b/drivers/tty/serial/earlycon.c
@@ -111,6 +111,8 @@ static int __init register_earlycon(char *buf, const struct earlycon_id *match)
int err;
struct uart_port *port = &early_console_dev.port;

+ spin_lock_init(&port->lock);
+
/* On parsing error, pass the options buf to the setup function */
if (buf && !parse_options(&early_console_dev, buf))
buf = NULL;
@@ -202,6 +204,7 @@ int __init of_setup_earlycon(unsigned long addr,
int err;
struct uart_port *port = &early_console_dev.port;

+ spin_lock_init(&port->lock);
port->iotype = UPIO_MEM;
port->mapbase = addr;
port->uartclk = BASE_BAUD * 16;
--
2.4.2


\
 
 \ /
  Last update: 2015-12-11 02:21    [W:0.422 / U:0.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site