bcm2835-dma: Fixes for dma_abort
There is a problem with the current abort scheme
when dma is blocked on a DREQ which prevents halting.
This is triggered by SPI driver which aborts dma
in this state and so leads to a halt timeout.
Discussion with Broadcom suggests the sequence:
CS.ACTIVE=0
while (CS.OUTSTANDING_TRANSACTIONS == 0)
wait()
DEBUG.RESET=1
should be safe on a dma40 channel.
Unfortunately the non-dma40 channels don't have
OUTSTANDING_TRANSACTIONS, so we need a more
complicated scheme.
We attempt to abort the channel, which will work
if there is no blocked DREQ.
It it times out, we can assume there is no AXI
transfer in progress and reset anyway.
The length of the timeout is observed at ~20us.
Signed-off-by: Dom Cobley <popcornmix@gmail.com>
Please register or sign in to comment