From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Cc: stable@vger.kernel.org, linux-amarula@amarulasolutions.com,
Alexandre Torgue <alexandre.torgue@foss.st.com>,
Erwan Le Ray <erwan.leray@foss.st.com>,
Valentin Caron <valentin.caron@foss.st.com>,
Jiri Slaby <jirislaby@kernel.org>,
Maxime Coquelin <mcoquelin.stm32@gmail.com>
Subject: Re: [PATCH 5.15] serial: stm32: rework RX over DMA
Date: Mon, 24 Jun 2024 17:02:32 +0200 [thread overview]
Message-ID: <2024062424-appeasing-mobster-9276@gregkh> (raw)
In-Reply-To: <20240620152658.1033479-1-dario.binacchi@amarulasolutions.com>
On Thu, Jun 20, 2024 at 05:26:57PM +0200, Dario Binacchi wrote:
> From: Erwan Le Ray <erwan.leray@foss.st.com>
>
> commit 33bb2f6ac3088936b7aad3cab6f439f91af0223c upstream.
>
> This patch reworks RX support over DMA to improve reliability:
> - change dma buffer cyclic configuration by using 2 periods. DMA buffer
> data are handled by a flip-flop between the 2 periods in order to avoid
> risk of data loss/corruption
> - change the size of dma buffer to 4096 to limit overruns
> - add rx errors management (breaks, parity, framing and overrun).
> When an error occurs on the uart line, the dma request line is masked at
> HW level. The SW must 1st clear DMAR (dma request line enable), to
> handle the error, then re-enable DMAR to recover. So, any correct data
> is taken from the DMA buffer, before handling the error itself. Then
> errors are handled from RDR/ISR/FIFO (e.g. in PIO mode). Last, DMA
> reception is resumed.
> - add a condition on DMA request line in DMA RX routines in order to
> switch to PIO mode when no DMA request line is disabled, even if the DMA
> channel is still enabled.
> When the UART is wakeup source and is configured to use DMA for RX, any
> incoming data that wakes up the system isn't correctly received.
> At data reception, the irq_handler handles the WUF irq, and then the
> data reception over DMA.
> As the DMA transfer has been terminated at suspend, and will be restored
> by resume callback (which has no yet been called by system), the data
> can't be received.
> The wake-up data has to be handled in PIO mode while suspend callback
> has not been called.
>
> Signed-off-by: Valentin Caron <valentin.caron@foss.st.com>
> Signed-off-by: Erwan Le Ray <erwan.leray@foss.st.com>
> Link: https://lore.kernel.org/r/20211020150332.10214-3-erwan.leray@foss.st.com
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> [ dario: fix conflicts for backport to v5.15. From the [1] series, only the
> first patch was applied to the v5.15 branch. This caused a regression in
> character reception, which can be fixed by applying the second patch. The
> patch has been tested on the stm32f469-disco board.
> [1] https://lore.kernel.org/all/20211020150332.10214-1-erwan.leray@foss.st.com/. ]
> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
>
> ---
>
> drivers/tty/serial/stm32-usart.c | 206 ++++++++++++++++++++++++-------
> drivers/tty/serial/stm32-usart.h | 12 +-
> 2 files changed, 165 insertions(+), 53 deletions(-)
>
Now queued up, thanks.
greg k-h
prev parent reply other threads:[~2024-06-24 15:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-20 15:26 [PATCH 5.15] serial: stm32: rework RX over DMA Dario Binacchi
2024-06-24 15:02 ` Greg Kroah-Hartman [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=2024062424-appeasing-mobster-9276@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=alexandre.torgue@foss.st.com \
--cc=dario.binacchi@amarulasolutions.com \
--cc=erwan.leray@foss.st.com \
--cc=jirislaby@kernel.org \
--cc=linux-amarula@amarulasolutions.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=stable@vger.kernel.org \
--cc=valentin.caron@foss.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