Skip to content

Commit

Permalink
tty: serial: fsl_lpuart: use GFP_ATOMIC under spin lock
Browse files Browse the repository at this point in the history
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: 5887ad4 ("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>
  • Loading branch information
Wei Yongjun authored and Greg Kroah-Hartman committed Sep 15, 2016
1 parent c164b00 commit 33ddca0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/tty/serial/fsl_lpuart.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 33ddca0

Please sign in to comment.