From: Erwan Le Ray <erwan.leray@foss.st.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jiri Slaby <jslaby@suse.com>,
Maxime Coquelin <mcoquelin.stm32@gmail.com>,
Alexandre Torgue <alexandre.torgue@foss.st.com>
Cc: <linux-serial@vger.kernel.org>,
<linux-stm32@st-md-mailman.stormreply.com>,
<linux-arm-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>,
Erwan Le Ray <erwan.leray@foss.st.com>,
Fabrice Gasnier <fabrice.gasnier@foss.st.com>,
Valentin Caron <valentin.caron@foss.st.com>,
Amelie Delaunay <amelie.delaunay@foss.st.com>
Subject: [PATCH 1/2] serial: stm32: reset dma buffers during probe
Date: Thu, 27 May 2021 11:15:36 +0200 [thread overview]
Message-ID: <20210527091537.8997-2-erwan.leray@foss.st.com> (raw)
In-Reply-To: <20210527091537.8997-1-erwan.leray@foss.st.com>
Reset Rx and Tx dma buffers during probe to avoid freeing
invalid buffer in no dma mode.
Signed-off-by: Erwan Le Ray <erwan.leray@foss.st.com>
diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c
index c2ae7b392b86..2ac3b30477a7 100644
--- a/drivers/tty/serial/stm32-usart.c
+++ b/drivers/tty/serial/stm32-usart.c
@@ -1168,6 +1168,8 @@ static struct stm32_port *stm32_usart_of_get_port(struct platform_device *pdev)
stm32_ports[id].cr1_irq = USART_CR1_RXNEIE;
stm32_ports[id].cr3_irq = 0;
stm32_ports[id].last_res = RX_BUF_L;
+ stm32_ports[id].rx_dma_buf = 0;
+ stm32_ports[id].tx_dma_buf = 0;
return &stm32_ports[id];
}
--
2.17.1
next prev parent reply other threads:[~2021-05-27 9:16 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-27 9:15 [PATCH 0/2] stm32 usart improve DMA probe Erwan Le Ray
2021-05-27 9:15 ` Erwan Le Ray [this message]
2021-05-27 9:49 ` [PATCH 1/2] serial: stm32: reset dma buffers during probe Greg Kroah-Hartman
2021-06-09 12:38 ` Greg Kroah-Hartman
2021-06-10 8:54 ` Erwan LE RAY
2021-05-27 9:15 ` [PATCH 2/2] serial: stm32: defer probe for dma devices Erwan Le Ray
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=20210527091537.8997-2-erwan.leray@foss.st.com \
--to=erwan.leray@foss.st.com \
--cc=alexandre.torgue@foss.st.com \
--cc=amelie.delaunay@foss.st.com \
--cc=fabrice.gasnier@foss.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-serial@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=mcoquelin.stm32@gmail.com \
--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;
as well as URLs for NNTP newsgroup(s).