From: Frank Rowand <frowand.list@gmail.com>
To: Bjorn Andersson <bjorn.andersson@linaro.org>,
Andy Gross <andy.gross@linaro.org>,
David Brown <david.brown@linaro.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jiri Slaby <jslaby@suse.com>
Cc: linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org,
linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org,
Nicolas Dechesne <nicolas.dechesne@linaro.org>,
Ivan Ivanov <iivanov.xz@gmail.com>,
Stephen Boyd <sboyd@codeaurora.org>,
stable@vger.kernel.org
Subject: Re: [PATCH] tty: serial: msm: Don't read off end of tx fifo
Date: Thu, 2 Jun 2016 20:59:15 -0700 [thread overview]
Message-ID: <57510093.5000702@gmail.com> (raw)
In-Reply-To: <1464914908-19059-1-git-send-email-bjorn.andersson@linaro.org>
On 06/02/16 17:48, Bjorn Andersson wrote:
> For dm uarts in pio mode tx data is transferred to the fifo register 4
> bytes at a time, but care is not taken when these 4 bytes spans the end
> of the xmit buffer so the loop might read up to 3 bytes past the buffer
> and then skip the actual data at the beginning of the buffer.
>
> Fix this by, analogous to the DMA case, make sure the chunk doesn't
> wrap the xmit buffer.
>
> Fixes: 3a878c430fd6 ("tty: serial: msm: Add TX DMA support")
> Cc: Andy Gross <andy.gross@linaro.org>
> Cc: Ivan Ivanov <iivanov.xz@gmail.com>
> Cc: Stephen Boyd <sboyd@codeaurora.org>
> Cc: stable@vger.kernel.org
> Reported-by: Frank Rowand <frowand.list@gmail.com>
> Reported-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> ---
> drivers/tty/serial/msm_serial.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/tty/serial/msm_serial.c b/drivers/tty/serial/msm_serial.c
> index b7d80bd57db9..7d62610d9de5 100644
> --- a/drivers/tty/serial/msm_serial.c
> +++ b/drivers/tty/serial/msm_serial.c
> @@ -726,7 +726,7 @@ static void msm_handle_tx(struct uart_port *port)
> return;
> }
>
> - pio_count = CIRC_CNT(xmit->head, xmit->tail, UART_XMIT_SIZE);
> + pio_count = CIRC_CNT_TO_END(xmit->head, xmit->tail, UART_XMIT_SIZE);
> dma_count = CIRC_CNT_TO_END(xmit->head, xmit->tail, UART_XMIT_SIZE);
>
> dma_min = 1; /* Always DMA */
>
Thanks Bjorn. This eliminates my symptoms on 4.6 and 4.7-rc1.
Tested-by: Frank Rowand <frank.rowand@am.sony.com>
-Frank
next prev parent reply other threads:[~2016-06-03 3:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-03 0:48 [PATCH] tty: serial: msm: Don't read off end of tx fifo Bjorn Andersson
2016-06-03 3:59 ` Frank Rowand [this message]
2016-06-04 0:03 ` Stephen Boyd
2016-06-05 18:44 ` Andy Gross
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=57510093.5000702@gmail.com \
--to=frowand.list@gmail.com \
--cc=andy.gross@linaro.org \
--cc=bjorn.andersson@linaro.org \
--cc=david.brown@linaro.org \
--cc=gregkh@linuxfoundation.org \
--cc=iivanov.xz@gmail.com \
--cc=jslaby@suse.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=linux-soc@vger.kernel.org \
--cc=nicolas.dechesne@linaro.org \
--cc=sboyd@codeaurora.org \
--cc=stable@vger.kernel.org \
/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.