mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-25 15:50:53 +07:00
serial: imx: fix the wrong number of scatterlist entries when xmit->head is 0
When the (xmit->tail > xmit->head) is true and the xmit->head is 0, we only need one DMA scatterlist in actually. Current code uses two DMA scatterlists in this case, this is obviously wrong. This patch fixes it. Signed-off-by: Huang Shijie <b32955@freescale.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
1ce43e58d4
commit
947c74eba8
@ -532,7 +532,7 @@ static void dma_tx_work(struct work_struct *w)
|
||||
return;
|
||||
}
|
||||
|
||||
if (xmit->tail > xmit->head) {
|
||||
if (xmit->tail > xmit->head && xmit->head > 0) {
|
||||
sport->dma_tx_nents = 2;
|
||||
sg_init_table(sgl, 2);
|
||||
sg_set_buf(sgl, xmit->buf + xmit->tail,
|
||||
|
Loading…
Reference in New Issue
Block a user