mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
tty: serial: fsl_lpuart: adjust buffer length to the intended size
[ Upstream commit f73fd750552524b06b5d77ebfdd106ccc8fcac61 ]
Based on the fls function definition provided below, we should not
subtract 1 to obtain the correct buffer length:
fls(0) = 0, fls(1) = 1, fls(0x80000000) = 32.
Fixes: 5887ad43ee ("tty: serial: fsl_lpuart: Use cyclic DMA for Rx")
Signed-off-by: Shenwei Wang <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
This commit is contained in:
parent
8fa80b452b
commit
488baa8038
1 changed files with 1 additions and 1 deletions
|
|
@ -1172,7 +1172,7 @@ static inline int lpuart_start_rx_dma(struct lpuart_port *sport)
|
|||
* 10ms at any baud rate.
|
||||
*/
|
||||
sport->rx_dma_rng_buf_len = (DMA_RX_TIMEOUT * baud / bits / 1000) * 2;
|
||||
sport->rx_dma_rng_buf_len = (1 << (fls(sport->rx_dma_rng_buf_len) - 1));
|
||||
sport->rx_dma_rng_buf_len = (1 << fls(sport->rx_dma_rng_buf_len));
|
||||
if (sport->rx_dma_rng_buf_len < 16)
|
||||
sport->rx_dma_rng_buf_len = 16;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue