Combinations of IO operations can cause "DMA transaction timed out" on Pi 5
Describe the bug
This Issues is currently a placeholder while the details are being investigated, but some combination of SPI, I2C and I2S traffic can lead to kernel messages from spidev saying "DMA transaction timed out", and "SPI transfer failed: -110". So far it appears that a reboot is necessary to clear the condition.
Steps to reproduce the behaviour
With an I2S-based soundcard attached, and with other audio outputs disabled so that the I2S card is the default, running these commands seems to be sufficient.
$ sudo apt install spi-tools
$ sudo dtparam spi=on # or put "dtparam=spi=on" in config.txt
$ dmesg -W & # So you know when it's failed
$ while true; do cat /boot/firmware/config.txt | spi-pipe -b 500 -d /dev/spidev0.0; done &
$ speaker-test -c 2 > /dev/null
It dies soon after speaker-test is started.
Observations:
- Running spi-pipe with small byte counts (e.g.
-b 10) doesn't trigger the problem - presumably because DMA is not invoked for transfers below the SPI FIFO size (64 bytes). - I2S is another DMA user, so the problem may be due to simultaneous DMA usage.
Device (s)
Raspberry Pi 5
System
It's a Pi5 running a current Bookworm release and a self-built kernel (probably not required).
Logs
No response
Additional context
No response
Probable cause of #5858.
Probably fixed by #6044.