Skip to content
Commit 5fc68a6c authored by Sekhar Nori's avatar Sekhar Nori Committed by Vinod Koul
Browse files

dma: edma: fix incorrect SG list handling



The code to handle any length SG lists calls edma_resume()
even before edma_start() is called. This is incorrect
because edma_resume() enables edma events on the channel
after which CPU (in edma_start) cannot clear posted
events by writing to ECR (per the EDMA user's guide).

Because of this EDMA transfers fail to start if due
to some reason there is a pending EDMA event registered
even before EDMA transfers are started. This can happen if
an EDMA event is a byproduct of device initialization.

Fix this by calling edma_resume() only if it is not the
first batch of MAX_NR_SG elements.

Without this patch, MMC/SD fails to function on DA850 EVM
with DMA. The behaviour is triggered by specific IP and
this can explain why the issue was not reported before
(example with MMC/SD on AM335x).

Tested on DA850 EVM and AM335x EVM-SK using MMC/SD card.

Cc: stable@vger.kernel.org # v3.12.x+
Cc: Joel Fernandes <joelf@ti.com>
Acked-by: default avatarJoel Fernandes <joelf@ti.com>
Tested-by: default avatarJon Ringle <jringle@gridpoint.com>
Tested-by: default avatarAlexander Holler <holler@ahsoftware.de>
Reported-by: default avatarJon Ringle <jringle@gridpoint.com>
Signed-off-by: default avatarSekhar Nori <nsekhar@ti.com>
Signed-off-by: default avatarVinod Koul <vinod.koul@intel.com>
parent c9eaa447
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment