All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Hurley <peter@hurleysoftware.com>
To: Anand Moon <linux.amoon@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jslaby@suse.com>,
	linux-serial@vger.kernel.org, linux-samsung-soc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Krzysztof Kozlowski <k.kozlowski@samsung.com>
Subject: Re: [PATCHv2] serial: samsung: drop the spinlock around uart_write_wakeup
Date: Fri, 19 Feb 2016 11:30:05 -0800	[thread overview]
Message-ID: <56C76D3D.3010009@hurleysoftware.com> (raw)
In-Reply-To: <1455858937-2380-1-git-send-email-linux.amoon@gmail.com>

[ +cc Krzysztof Kozlowski ]

On 02/18/2016 09:15 PM, Anand Moon wrote:
> From: Anand Moon <linux.amoon@gmail.com>
> 
> drop the spin_unlock/lock around uart_write_wakeup to protect
> write wakeup for uart port.

What Krzysztof was saying wrt v1 of this patch is that the
changelog should provide as much information as possible to
the maintainer(s) and driver author(s), and that you should
test that outcome.

Here's what I would have written for a commit message:


  Remove deadlock workaround for line disciplines that invoke
  the tty driver's write() method directly from their write_wakeup()
  method. As documented for the write_wakeup() line discipline method
  in tty_ldisc.h, line disciplines must not attempt i/o directly
  from write_wakeup() as this will deadlock. Reviews of in-tree line
  disciplines confirm all defer i/o.

  NB: This workaround was added in commit c15c3747ee32
  ("serial: samsung: fix potential soft lockup during uart write")
  which notes both slip and bluetooth hci attempt i/o directly from
  write_wakeup(). These issues were fixed in commits 661f7fda21b1
  ("slip: Fix deadlock in write_wakeup") and da64c27d3c93
  ("bluetooth: hci_ldisc: fix deadlock condition"), respectively.


Regards,
Peter Hurley


PS - Minor procedural note: please cc those who have reviewed previous
     patch versions when you submit new versions, ok?  Not a big deal,
     lots of submitters don't, but it's still preferred.


> Signed-off-by: Anand Moon <linux.amoon@gmail.com>
> ---
> changes logs: drop the previous approch of spin_unlock_irqrestore/save
> ---
>  drivers/tty/serial/samsung.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c
> index d72cd73..0cb70a9 100644
> --- a/drivers/tty/serial/samsung.c
> +++ b/drivers/tty/serial/samsung.c
> @@ -758,11 +758,8 @@ static irqreturn_t s3c24xx_serial_tx_chars(int irq, void *id)
>  		goto out;
>  	}
>  
> -	if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) {
> -		spin_unlock(&port->lock);
> +	if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS)
>  		uart_write_wakeup(port);
> -		spin_lock(&port->lock);
> -	}
>  
>  	if (uart_circ_empty(xmit))
>  		s3c24xx_serial_stop_tx(port);
> 

  reply	other threads:[~2016-02-19 19:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-19  5:15 [PATCHv2] serial: samsung: drop the spinlock around uart_write_wakeup Anand Moon
2016-02-19 19:30 ` Peter Hurley [this message]
2016-02-20  3:36   ` Anand Moon
2016-02-21  1:37   ` Krzysztof Kozlowski
2016-02-21  2:59     ` Anand Moon
2016-02-22  0:08       ` Krzysztof Kozlowski
2016-02-22  3:31         ` Anand Moon

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=56C76D3D.3010009@hurleysoftware.com \
    --to=peter@hurleysoftware.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jslaby@suse.com \
    --cc=k.kozlowski@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=linux.amoon@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.