Skip to content

Commit 8f4f1ef

Browse files
Martinhoff-makerkartben
authored andcommitted
drivers: dma: siwx91x: fix interrupt flag reset
This patch fix a reg write that needs to be done before calling the callback. Since the user can start a new dma transfer in the callback, it can miss the interrupt from the new transfer if the new transfer is done before the interrupt bit is cleared. Signed-off-by: Martin Hoff <[email protected]>
1 parent aa31594 commit 8f4f1ef

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/dma/dma_silabs_siwx91x.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,6 +669,7 @@ static void siwx91x_dma_isr(const struct device *dev)
669669
}
670670

671671
if (data->chan_info[channel].Cnt == data->chan_info[channel].Size) {
672+
sys_write32(BIT(channel), (mem_addr_t)&cfg->reg->UDMA_DONE_STATUS_REG);
672673
if (data->zephyr_channel_info[channel].channel_active) {
673674
pm_device_runtime_put_async(dev, K_NO_WAIT);
674675
data->zephyr_channel_info[channel].channel_active = false;
@@ -678,7 +679,6 @@ static void siwx91x_dma_isr(const struct device *dev)
678679
data->zephyr_channel_info[channel].dma_callback(
679680
dev, data->zephyr_channel_info[channel].cb_data, channel, 0);
680681
}
681-
sys_write32(BIT(channel), (mem_addr_t)&cfg->reg->UDMA_DONE_STATUS_REG);
682682
} else {
683683
/* Call UDMA ROM IRQ handler. */
684684
ROMAPI_UDMA_WRAPPER_API->uDMAx_IRQHandler(&udma_resources, udma_resources.desc,

0 commit comments

Comments
 (0)