]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
dmaengine: pxa: handle bus errors
authorRobert Jarzmik <robert.jarzmik@free.fr>
Mon, 28 Mar 2016 21:32:24 +0000 (23:32 +0200)
committerVinod Koul <vinod.koul@intel.com>
Tue, 26 Apr 2016 03:33:57 +0000 (09:03 +0530)
commite093bf60ca498a03b4ea8f5d6cf1d520a68e5d2e
treef65c6272c314bb51dab1d3972533435739776722
parentf55532a0c0b8bb6148f4e07853b876ef73bc69ca
dmaengine: pxa: handle bus errors

In the current state, upon bus error the driver will spin endlessly,
relaunching the last tx, which will fail again and again :
 - a bus error happens
 - pxad_chan_handler() is called
 - as PXA_DCSR_STOPSTATE is true, the last non-terminated transaction is
   lauched, which is the one triggering the bus error, as it didn't
   terminate
 - moreover, the STOP interrupt fires a new, as the STOPIRQEN is still
   active

Break this logic by stopping the automatic relaunch of a dma channel
upon a bus error, even if there are still pending issued requests on it.

As dma_cookie_status() seems unable to return DMA_ERROR in its current
form, ie. there seems no way to mark a DMA_ERROR on a per-async-tx
basis, it is chosen in this patch to remember on the channel which
transaction failed, and report it in pxad_tx_status().

It's a bit misleading because if T1, T2, T3 and T4 were queued, and T1
was completed while T2 causes a bus error, the status of T3 and T4 will
be reported as DMA_IN_PROGRESS, while the channel is actually stopped.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
drivers/dma/pxa_dma.c