From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1426391AbcBRRsb (ORCPT ); Thu, 18 Feb 2016 12:48:31 -0500 Received: from mail-pf0-f169.google.com ([209.85.192.169]:33500 "EHLO mail-pf0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1425448AbcBRRs3 (ORCPT ); Thu, 18 Feb 2016 12:48:29 -0500 Subject: Re: [PATCH] serial: samsung: fix the inconsistency in spinlock To: Anand Moon , Greg Kroah-Hartman , Jiri Slaby References: <1455817202-3005-1-git-send-email-linux.amoon@gmail.com> Cc: linux-serial@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org From: Peter Hurley Message-ID: <56C603E9.9050307@hurleysoftware.com> Date: Thu, 18 Feb 2016 09:48:25 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <1455817202-3005-1-git-send-email-linux.amoon@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Anand, On 02/18/2016 09:40 AM, Anand Moon wrote: > From: Anand Moon > > changes fix the correct order of the spin_lock_irqrestore/save. > > Signed-off-by: Anand Moon > --- > 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)) >