tty: serial: fsl_lpuart: use GFP_ATOMIC under spin lock
authorWei Yongjun <weiyongjun1@huawei.com>
Thu, 8 Sep 2016 15:03:24 +0000 (15:03 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 15 Sep 2016 10:35:49 +0000 (12:35 +0200)
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>
drivers/tty/serial/fsl_lpuart.c

index b21f3e54171439d3204a9f7f6216ea1a3815ad79..de9d5107c00a0e1430b9ad8f8dfb99b7d4b2c9b3 100644 (file)
@@ -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;