Linux Serial subsystem development
 help / color / mirror / Atom feed
From: Patrice CHOTARD <patrice.chotard@st.com>
To: Lionel DEBIEVE <lionel.debieve@st.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jslaby@suse.com>
Cc: "linux-serial@vger.kernel.org" <linux-serial@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"linux-rt-users@vger.kernel.org" <linux-rt-users@vger.kernel.org>
Subject: Re: [PATCH 1/1] tty: serial: st-asc: Make the locking RT aware
Date: Thu, 23 Mar 2017 07:56:27 +0000	[thread overview]
Message-ID: <d592cad0-1509-4eec-1012-7af17f9e577c@st.com> (raw)
In-Reply-To: <1490202751-16581-1-git-send-email-lionel.debieve@st.com>

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 <lionel.debieve@st.com>

Acked-by: Patrice Chotard <patrice.chotard@st.com>


> ---
>  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)
>

  reply	other threads:[~2017-03-23  7:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-22 17:12 [PATCH 1/1] tty: serial: st-asc: Make the locking RT aware Lionel Debieve
2017-03-23  7:56 ` Patrice CHOTARD [this message]
2017-03-29 16:10 ` Sebastian Andrzej Siewior

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d592cad0-1509-4eec-1012-7af17f9e577c@st.com \
    --to=patrice.chotard@st.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jslaby@suse.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=lionel.debieve@st.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox