samv7/sam_serial.c: reset all DMA pointers on DMA setup

This small fix ensures all DMA pointers are correctly reseted during
DMA setup (when the driver is opened). Without this there could be rare
occurrence of driver pointer to incorrect (invalidate) DMA buffer and thus
saving incorrect characters to upper layer.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
This commit is contained in:
Michal Lenc 2023-07-03 12:43:06 +02:00 committed by Petro Karashchenko
parent 49f153abb1
commit d470c3f268

View file

@ -1228,6 +1228,8 @@ static int sam_dma_setup(struct uart_dev_s *dev)
*/
priv->rxdmanext = 0;
priv->nextcache = 0;
priv->buf_idx = 0;
priv->rxenable = true;
priv->odd = false;