mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bhuvanchandra DV <bhuvanchandra.dv@toradex.com>
To: Aaron Brice <aaron.brice@datasoft.com>,
	<gregkh@linuxfoundation.org>, <jslaby@suse.com>,
	<stefan@agner.ch>
Cc: <linux-serial@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH] tty: serial: fsl_lpuart: Fix Tx DMA edge case
Date: Mon, 10 Oct 2016 16:42:13 +0530	[thread overview]
Message-ID: <6d198918-c5a8-45e6-a2a8-5af5de61abce@toradex.com> (raw)
In-Reply-To: <1475791984-17705-1-git-send-email-aaron.brice@datasoft.com>

On 10/07/16 03:43, Aaron Brice wrote:

> In the case where head == 0 on the circular buffer, there should be one
> DMA buffer, not two.  The second zero-length buffer would break the
> lpuart driver, transfer would never complete.

Tested-by: Bhuvanchandra DV <bhuvanchandra.dv@toradex.com>

>
> Signed-off-by: Aaron Brice <aaron.brice@datasoft.com>
> ---
>   drivers/tty/serial/fsl_lpuart.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c
> index de9d510..76103f2 100644
> --- a/drivers/tty/serial/fsl_lpuart.c
> +++ b/drivers/tty/serial/fsl_lpuart.c
> @@ -328,7 +328,7 @@ static void lpuart_dma_tx(struct lpuart_port *sport)
>   
>   	sport->dma_tx_bytes = uart_circ_chars_pending(xmit);
>   
> -	if (xmit->tail < xmit->head) {
> +	if (xmit->tail < xmit->head || xmit->head == 0) {
>   		sport->dma_tx_nents = 1;
>   		sg_init_one(sgl, xmit->buf + xmit->tail, sport->dma_tx_bytes);
>   	} else {
> @@ -359,7 +359,6 @@ static void lpuart_dma_tx(struct lpuart_port *sport)
>   	sport->dma_tx_in_progress = true;
>   	sport->dma_tx_cookie = dmaengine_submit(sport->dma_tx_desc);
>   	dma_async_issue_pending(sport->dma_tx_chan);
> -
>   }
>   
>   static void lpuart_dma_tx_complete(void *arg)

      parent reply	other threads:[~2016-10-10 15:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-06 22:13 Aaron Brice
2016-10-07 18:06 ` Stefan Agner
2016-10-10 11:12 ` Bhuvanchandra DV [this message]

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=6d198918-c5a8-45e6-a2a8-5af5de61abce@toradex.com \
    --to=bhuvanchandra.dv@toradex.com \
    --cc=aaron.brice@datasoft.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jslaby@suse.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=stefan@agner.ch \
    /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

all inboxes | Powered by JetHome®