Patch "tty: serial: atmel: Check return code of dmaengine_submit()" has been added to the 5.10-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    tty: serial: atmel: Check return code of dmaengine_submit()

to the 5.10-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     tty-serial-atmel-check-return-code-of-dmaengine_subm.patch
and it can be found in the queue-5.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 02f00b225708eb6a31c7d8b413acf17a9a287218
Author: Tudor Ambarus <tudor.ambarus@xxxxxxxxxxxxx>
Date:   Thu Nov 25 11:00:17 2021 +0200

    tty: serial: atmel: Check return code of dmaengine_submit()
    
    [ Upstream commit 1e67bd2b8cb90b66e89562598e9c2046246832d3 ]
    
    The tx_submit() method of struct dma_async_tx_descriptor is entitled
    to do sanity checks and return errors if encountered. It's not the
    case for the DMA controller drivers that this client is using
    (at_h/xdmac), because they currently don't do sanity checks and always
    return a positive cookie at tx_submit() method. In case the controller
    drivers will implement sanity checks and return errors, print a message
    so that the client will be informed that something went wrong at
    tx_submit() level.
    
    Fixes: 08f738be88bb ("serial: at91: add tx dma support")
    Signed-off-by: Tudor Ambarus <tudor.ambarus@xxxxxxxxxxxxx>
    Acked-by: Richard Genoud <richard.genoud@xxxxxxxxx>
    Link: https://lore.kernel.org/r/20211125090028.786832-3-tudor.ambarus@xxxxxxxxxxxxx
    Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c
index a24e5c2b30bc9..396fe8c51f93b 100644
--- a/drivers/tty/serial/atmel_serial.c
+++ b/drivers/tty/serial/atmel_serial.c
@@ -1004,6 +1004,11 @@ static void atmel_tx_dma(struct uart_port *port)
 		desc->callback = atmel_complete_tx_dma;
 		desc->callback_param = atmel_port;
 		atmel_port->cookie_tx = dmaengine_submit(desc);
+		if (dma_submit_error(atmel_port->cookie_tx)) {
+			dev_err(port->dev, "dma_submit_error %d\n",
+				atmel_port->cookie_tx);
+			return;
+		}
 	}
 
 	if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS)
@@ -1264,6 +1269,11 @@ static int atmel_prepare_rx_dma(struct uart_port *port)
 	desc->callback_param = port;
 	atmel_port->desc_rx = desc;
 	atmel_port->cookie_rx = dmaengine_submit(desc);
+	if (dma_submit_error(atmel_port->cookie_rx)) {
+		dev_err(port->dev, "dma_submit_error %d\n",
+			atmel_port->cookie_rx);
+		goto chan_err;
+	}
 
 	return 0;
 



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux