Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752588AbdCWH5N convert rfc822-to-8bit (ORCPT ); Thu, 23 Mar 2017 03:57:13 -0400 Received: from mx07-00178001.pphosted.com ([62.209.51.94]:19864 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751252AbdCWH5L (ORCPT ); Thu, 23 Mar 2017 03:57:11 -0400 From: Patrice CHOTARD To: Lionel DEBIEVE , Greg Kroah-Hartman , Jiri Slaby CC: "linux-serial@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-rt-users@vger.kernel.org" Subject: Re: [PATCH 1/1] tty: serial: st-asc: Make the locking RT aware Thread-Topic: [PATCH 1/1] tty: serial: st-asc: Make the locking RT aware Thread-Index: AQHSoy+XiNxCj0l3OUqX8RAftekApqGh/s+A Date: Thu, 23 Mar 2017 07:56:27 +0000 Message-ID: References: <1490202751-16581-1-git-send-email-lionel.debieve@st.com> In-Reply-To: <1490202751-16581-1-git-send-email-lionel.debieve@st.com> Accept-Language: fr-FR, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.75.127.51] Content-Type: text/plain; charset="Windows-1252" Content-ID: <39AE01551037084B8D4FD5D8BD671354@st.com> Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-03-23_07:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1468 Lines: 47 Hi Lionel On 03/22/2017 06:12 PM, Lionel Debieve wrote: > 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: Lionel Debieve Acked-by: Patrice Chotard > --- > drivers/tty/serial/st-asc.c | 8 +++----- > 1 file changed, 3 insertions(+), 5 deletions(-) > > diff --git a/drivers/tty/serial/st-asc.c b/drivers/tty/serial/st-asc.c > index c334bcc..4889396 100644 > --- a/drivers/tty/serial/st-asc.c > +++ b/drivers/tty/serial/st-asc.c > @@ -887,13 +887,12 @@ static void asc_console_write(struct console *co, const char *s, unsigned count) > int locked = 1; > u32 intenable; > > - local_irq_save(flags); > if (port->sysrq) > locked = 0; /* asc_interrupt has already claimed the lock */ > else if (oops_in_progress) > - locked = spin_trylock(&port->lock); > + locked = spin_trylock_irqsave(&port->lock, flags); > else > - spin_lock(&port->lock); > + spin_lock_irqsave(&port->lock, flags); > > /* > * 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) > asc_out(port, ASC_INTEN, intenable); > > if (locked) > - spin_unlock(&port->lock); > - local_irq_restore(flags); > + spin_unlock_irqrestore(&port->lock, flags); > } > > static int asc_console_setup(struct console *co, char *options) >