lkml.org 
[lkml]   [2014]   [Oct]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] tty: serial: msm: Fix lock init issue with earlycon
On 10/17/2014 06:13 AM, Kumar Gala wrote:
> With CONFIG_DEBUG_SPINLOCK enabled we see:
>
> BUG: spinlock bad magic on CPU#0, swapper/0
> lock: early_console_dev+0x8/0x160, .magic: 00000000, .owner: <none>/-1, .owner_cpu: 0
> CPU: 0 PID: 0 Comm: swapper Not tainted 3.17.0-09733-gb446b33-dirty #18

[...]

> diff --git a/drivers/tty/serial/msm_serial.c b/drivers/tty/serial/msm_serial.c
> index 4b6c783..8ab27c9 100644
> --- a/drivers/tty/serial/msm_serial.c
> +++ b/drivers/tty/serial/msm_serial.c
> @@ -973,6 +973,8 @@ msm_serial_early_console_setup(struct earlycon_device *device, const char *opt)
> if (!device->port.membase)
> return -ENODEV;
>
> + spin_lock_init(&device->port.lock);
> +
> device->con->write = msm_serial_early_write;
> return 0;
> }
> @@ -995,6 +997,8 @@ msm_serial_early_console_setup_dm(struct earlycon_device *device,
> if (!device->port.membase)
> return -ENODEV;
>
> + spin_lock_init(&device->port.lock);
> +
> device->con->write = msm_serial_early_write_dm;
> return 0;
> }

Could this be done in the tty core instead?

--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project



\
 
 \ /
  Last update: 2014-10-20 20:41    [W:0.065 / U:1.208 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site