cancel
Showing results for 
Search instead for 
Did you mean: 

stm32-dmamux 48002000.dma-router: Run out of free DMA requests

KWatt.2
Associate

Hi,

I've noticed when booting one of our board designs with a STM32MP157C in openstlinux-5.4-dunfell-mp1-20-11-12 with Weston Wayland under the STM32MP157-Ecosystem-v2.1.0 that multiple times when the kernel is loading I'll see the message "stm32-dmamux 48002000.dma-router: Run out of free DMA requests" reported to std-out.

Does anyone know if when this occurs, what kind of behavior STM32 modules that attempted to issue a DMA request will have? Do they fall back to using a non-DMA access mode, wait until a free request becomes available, or just fail outright?

I've attempted to find an answer to this in the dmamux documentation but did not see anything addressing this and looking at the code for the implementation itself, it didn't seem immediately obvious either.

Any assistance would be appreciated, thank you.

3 REPLIES 3
Christophe Guibout
ST Employee

Hi @KWatt.2​ ,

Could you please tell us more about the DMA DT configuration of your board ?

Do you use DMA2 on CM4 so that it only remains 8 dma-channels inside dmamux on linux side ?

BR,

Christophe

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
KWatt.2
Associate

Hi Christophe,

From what I can tell we're currently setup to use DMA1 on the A7NS and DMA2 on the M4. So yes it seems correct there would only be 8 dma-channels inside dmamux on the linux side at this point.

When the number of free DMA request have run out though, are requests queued and then serviced as they're free'd up or this dependent upon the requester's implementation?

Christophe Guibout
ST Employee

Hi @KWatt.2​ ,

DMA channels are taken by drivers on probe, are they are released if someone unprobe the driver.

If you want to get the list of assigned DMA channels, you can add this line at the end of the kernel cmdline :

dyndbg="file drivers/dma/stm32-dmamux.c +p

and it will display logs when a DMA channel is reserved :

root@stm32mp1:~# dmesg | grep dmamux
[    0.000000] Kernel command line: root=PARTUUID=e91c4e10-16e6-4c0e-bd0e-77becf4a3582 rootwait rw console=ttySTM0,115200 dyndbg="file drivers/dma/stm32-dmamux.c +p"
[    1.784987] stm32-dmamux 48002000.dma-router: Mapping DMAMUX(43) to DMA0(0)
[    1.785198] stm32-dmamux 48002000.dma-router: Mapping DMAMUX(44) to DMA0(1)
[    3.403188] stm32-dmamux 48002000.dma-router: Mapping DMAMUX(89) to DMA0(2)
[    3.405212] stm32-dmamux 48002000.dma-router: Mapping DMAMUX(90) to DMA0(3)
[    3.429329] stm32-dmamux 48002000.dma-router: Mapping DMAMUX(40) to DMA0(4)
[    3.429426] stm32-dmamux 48002000.dma-router: Mapping DMAMUX(39) to DMA0(5)

If the list contains 8 channels and displays an error, that means too many drivers want to use DMA, so you will have to select which driver is allowed to use DMA (most of the time, this is done in the device tree).

By looking just after the stm32-dmamux log in dmesg, you will find who allocates the channel :

[    1.784987] stm32-dmamux 48002000.dma-router: Mapping DMAMUX(43) to DMA0(0)
[    1.785198] stm32-dmamux 48002000.dma-router: Mapping DMAMUX(44) to DMA0(1)
[    1.785713] 4000e000.serial: ttySTM3 at MMIO 0x4000e000 (irq = 61, base_baud = 4000000) is a stm32-usart

BR,

Christophe

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.