-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Description
After latest changes in eDMA and related to this I2S MCUX SAI driver eDMA error handler is invoked after first reload of buffer.
Use case:
- two audio buffers in a slab
- both of them allocated and written before the trigger start
- after first buffer is freed it is allocated and written again than edma error occurs
This problem did not happen before the changes.
Breakpoint 3, i2s_mcux_write (dev=0x3002ba0c <__device_dts_ord_458>, mem_block=0x2000a568 <malloc_arena+2664>, size=2048)
at /home/radekp/projects/zephyrproject/zephyr/drivers/i2s/i2s_mcux_sai.c:1019
1019 {
(gdb) c
Continuing.
Breakpoint 3, i2s_mcux_write (dev=0x3002ba0c <__device_dts_ord_458>, mem_block=0x2000ad68 <malloc_arena+4712>, size=2048)
at /home/radekp/projects/zephyrproject/zephyr/drivers/i2s/i2s_mcux_sai.c:1019
1019 {
(gdb) c
Continuing.
Breakpoint 1, i2s_dma_tx_callback (dma_dev=0x3002b8b8 <__device_dts_ord_455>, arg=0x3002ba0c <__device_dts_ord_458>, channel=31, status=0)
at /home/radekp/projects/zephyrproject/zephyr/drivers/i2s/i2s_mcux_sai.c:261
261 {
(gdb) c
Continuing.
Breakpoint 3, i2s_mcux_write (dev=0x3002ba0c <__device_dts_ord_458>, mem_block=0x2000a568 <malloc_arena+2664>, size=2048)
at /home/radekp/projects/zephyrproject/zephyr/drivers/i2s/i2s_mcux_sai.c:1019
1019 {
(gdb) c
Continuing.
Breakpoint 1, i2s_dma_tx_callback (dma_dev=0x3002b8b8 <__device_dts_ord_455>, arg=0x3002ba0c <__device_dts_ord_458>, channel=31, status=0)
at /home/radekp/projects/zephyrproject/zephyr/drivers/i2s/i2s_mcux_sai.c:261
261 {
(gdb) c
Continuing.
Breakpoint 2, dma_mcux_edma_error_irq_handler (dev=0x3002b8b8 <__device_dts_ord_455>) at /home/radekp/projects/zephyrproject/zephyr/drivers/dma/dma_mcux_edma.c:258
(gdb) (gdb) p/x ((struct dma_mcux_edma_data*)dev->data)->data_cb[31]
$6 = {transferConfig = {srcAddr = 0x2000a568, destAddr = 0x40404020, srcTransferSize = 0x2, destTransferSize = 0x2, srcOffset = 0x4, destOffset = 0x0, minorLoopBytes = 0x4,
majorLoopCounts = 0x200}, edma_handle = {callback = 0x30027439, userData = 0x20002fe4, base = 0x40070000, tcdPool = 0x0, channel = 0x1f, header = 0x0, tail = 0x0, tcdUsed = 0x0,
tcdSize = 0x0, flags = 0x0}, dev = 0x3002b8b8, user_data = 0x3002ba0c, dma_callback = 0x30012d31, transfer_settings = {source_data_size = 0x4, dest_data_size = 0x4,
source_burst_length = 0x4, dest_burst_length = 0x4, direction = 0x1, transfer_type = 0x2, valid = 0x1, cyclic = 0x1, write_idx = 0x3, empty_tcds = 0x3}, busy = 0x1}
The situation does not happen when I revert 7145295. but the sound is glitchy.