Linux Kernels

tty: serial: fsl_lpuart: use GFP_ATOMIC under spin lock

This change “tty: serial: fsl_lpuart: use GFP_ATOMIC under spin lock” (commit 33ddca0) in Linux kernel is authored by Wei Yongjun <weiyongjun1 [at] huawei.com> on Thu Sep 8 15:03:24 2016 +0000.

Description of "tty: serial: fsl_lpuart: use GFP_ATOMIC under spin lock"

The change “tty: serial: fsl_lpuart: use GFP_ATOMIC under spin lock” introduces changes as follows.

tty: serial: fsl_lpuart: use GFP_ATOMIC under spin lock

The function lpuart_start_rx_dma() is called from several
places, in some of which, such as lpuart_startup(), a lock
be held here, so we should use GFP_ATOMIC when a lock is held.

Fixes: 5887ad43ee02 ("tty: serial: fsl_lpuart: Use cyclic DMA for Rx")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Linux kernel releases containing commit 33ddca0

The Linux kernel releases containing this commit are as follows.

Linux kernel code changes from "tty: serial: fsl_lpuart: use GFP_ATOMIC under spin lock"

There are 2 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 drivers/tty/serial/fsl_lpuart.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
 
diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c
index b21f3e541714..de9d5107c00a 100644
--- a/drivers/tty/serial/fsl_lpuart.c
+++ b/drivers/tty/serial/fsl_lpuart.c
@@ -852,7 +852,7 @@ static inline int lpuart_start_rx_dma(struct lpuart_port *sport)
 	if (sport->rx_dma_rng_buf_len < 16)
 		sport->rx_dma_rng_buf_len = 16;
 
-	ring->buf = kmalloc(sport->rx_dma_rng_buf_len, GFP_KERNEL);
+	ring->buf = kmalloc(sport->rx_dma_rng_buf_len, GFP_ATOMIC);
 	if (!ring->buf) {
 		dev_err(sport->port.dev, "Ring buf alloc failed\n");
 		return -ENOMEM;

The commit for this change in Linux stable tree is 33ddca0 (patch).

Last modified: 2020/01/11 09:38