lkml.org 
[lkml]   [2016]   [Feb]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] serial: samsung: fix the inconsistency in spinlock
From
Date
Hi Anand,

On 02/18/2016 09:40 AM, Anand Moon wrote:
> From: Anand Moon <linux.amoon@gmail.com>
>
> changes fix the correct order of the spin_lock_irqrestore/save.
>
> Signed-off-by: Anand Moon <linux.amoon@gmail.com>
> ---
> drivers/tty/serial/samsung.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c
> index d72cd73..96fe14d 100644
> --- a/drivers/tty/serial/samsung.c
> +++ b/drivers/tty/serial/samsung.c
> @@ -759,9 +759,9 @@ static irqreturn_t s3c24xx_serial_tx_chars(int irq, void *id)
> }
>
> if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) {
> - spin_unlock(&port->lock);
> + spin_unlock_irqrestore(&port->lock, flags);
> uart_write_wakeup(port);
> - spin_lock(&port->lock);
> + spin_lock_irqsave(&port->lock, flags);

This driver shouldn't be dropping the spin lock at for write wakeup.
If this is causing lock-ups in a line discipline, the line discipline
needs fixed.

Regards,
Peter Hurley


> }
>
> if (uart_circ_empty(xmit))
>

\
 
 \ /
  Last update: 2016-02-18 19:21    [W:0.128 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site