Commit 33ddca08 authored by Wei Yongjun's avatar Wei Yongjun Committed by Greg Kroah-Hartman

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: 5887ad43 ("tty: serial: fsl_lpuart: Use cyclic DMA for Rx")
Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c164b008
...@@ -852,7 +852,7 @@ static inline int lpuart_start_rx_dma(struct lpuart_port *sport) ...@@ -852,7 +852,7 @@ static inline int lpuart_start_rx_dma(struct lpuart_port *sport)
if (sport->rx_dma_rng_buf_len < 16) if (sport->rx_dma_rng_buf_len < 16)
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) { if (!ring->buf) {
dev_err(sport->port.dev, "Ring buf alloc failed\n"); dev_err(sport->port.dev, "Ring buf alloc failed\n");
return -ENOMEM; return -ENOMEM;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment