diff options
| author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-10-16 20:46:20 +0200 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-10-16 20:46:20 +0200 |
| commit | 5f19ca4e014f2bd4088b78f31426f0ba3b8e6a3c (patch) | |
| tree | 7357ef42d49b5ff46e1f9c7d0f873a3606b612f4 /drivers/dma/stm32-dma.c | |
| parent | d712d205210c494c29f33dc1d1f2ce4d7448faa9 (diff) | |
| parent | 58720809f52779dc0f08e53e54b014209d13eebb (diff) | |
| download | linux-5f19ca4e014f2bd4088b78f31426f0ba3b8e6a3c.tar.gz linux-5f19ca4e014f2bd4088b78f31426f0ba3b8e6a3c.tar.bz2 linux-5f19ca4e014f2bd4088b78f31426f0ba3b8e6a3c.zip | |
Merge 6.6-rc6 into char-misc-next
We need the char/misc fixes in here as well, to build on for other
changes.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/dma/stm32-dma.c')
| -rw-r--r-- | drivers/dma/stm32-dma.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/dma/stm32-dma.c b/drivers/dma/stm32-dma.c index 5c36811aa134..0b30151fb45c 100644 --- a/drivers/dma/stm32-dma.c +++ b/drivers/dma/stm32-dma.c @@ -1113,8 +1113,10 @@ static struct dma_async_tx_descriptor *stm32_dma_prep_slave_sg( chan->chan_reg.dma_scr &= ~STM32_DMA_SCR_PFCTRL; /* Activate Double Buffer Mode if DMA triggers STM32 MDMA and more than 1 sg */ - if (chan->trig_mdma && sg_len > 1) + if (chan->trig_mdma && sg_len > 1) { chan->chan_reg.dma_scr |= STM32_DMA_SCR_DBM; + chan->chan_reg.dma_scr &= ~STM32_DMA_SCR_CT; + } for_each_sg(sgl, sg, sg_len, i) { ret = stm32_dma_set_xfer_param(chan, direction, &buswidth, @@ -1387,11 +1389,12 @@ static size_t stm32_dma_desc_residue(struct stm32_dma_chan *chan, residue = stm32_dma_get_remaining_bytes(chan); - if (chan->desc->cyclic && !stm32_dma_is_current_sg(chan)) { + if ((chan->desc->cyclic || chan->trig_mdma) && !stm32_dma_is_current_sg(chan)) { n_sg++; if (n_sg == chan->desc->num_sgs) n_sg = 0; - residue = sg_req->len; + if (!chan->trig_mdma) + residue = sg_req->len; } /* @@ -1401,7 +1404,7 @@ static size_t stm32_dma_desc_residue(struct stm32_dma_chan *chan, * residue = remaining bytes from NDTR + remaining * periods/sg to be transferred */ - if (!chan->desc->cyclic || n_sg != 0) + if ((!chan->desc->cyclic && !chan->trig_mdma) || n_sg != 0) for (i = n_sg; i < desc->num_sgs; i++) residue += desc->sg_req[i].len; |
