diff mbox series

[1/7] dmaengine: mmp_tdma: Do not ignore slave config validation errors

Message ID 20200419164912.670973-2-lkundrak@v3.sk (mailing list archive)
State Accepted
Headers show
Series dmaengine: mmp_tdma: Make the driver actually work | expand

Commit Message

Lubomir Rintel April 19, 2020, 4:49 p.m. UTC
With an invalid dma_slave_config set previously,
mmp_tdma_prep_dma_cyclic() would detect an error whilst configuring the
channel, but proceed happily on:

  [  120.756530] mmp-tdma d42a0800.adma: mmp_tdma: unknown burst size.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
---
 drivers/dma/mmp_tdma.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Vinod Koul April 23, 2020, 7:13 a.m. UTC | #1
On 19-04-20, 18:49, Lubomir Rintel wrote:
> With an invalid dma_slave_config set previously,
> mmp_tdma_prep_dma_cyclic() would detect an error whilst configuring the
> channel, but proceed happily on:
> 
>   [  120.756530] mmp-tdma d42a0800.adma: mmp_tdma: unknown burst size.

Applied to fixes, thanks
diff mbox series

Patch

diff --git a/drivers/dma/mmp_tdma.c b/drivers/dma/mmp_tdma.c
index 10117f271b12b..51e08c16756ae 100644
--- a/drivers/dma/mmp_tdma.c
+++ b/drivers/dma/mmp_tdma.c
@@ -443,7 +443,8 @@  static struct dma_async_tx_descriptor *mmp_tdma_prep_dma_cyclic(
 	if (!desc)
 		goto err_out;
 
-	mmp_tdma_config_write(chan, direction, &tdmac->slave_config);
+	if (mmp_tdma_config_write(chan, direction, &tdmac->slave_config))
+		goto err_out;
 
 	while (buf < buf_len) {
 		desc = &tdmac->desc_arr[i];