dmaengine: pl330: fix bug that chan descdone is null

The pl330 irq may come after terminal chan, and desc is
set null. It can't be avoided by disabling irq, because
other chans use the common irq. If the chan is terminaled,
we needn't call its callback or restart it.

Change-Id: I73201eaa4dbdd09c765129f9f3f41573c73faf73
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
This commit is contained in:
Huibin Hong
2018-01-29 10:02:35 +08:00
committed by Tao Huang
parent 1b69a6a2e8
commit c03395df9c

View File

@@ -1787,16 +1787,17 @@ static int pl330_update(struct pl330_dmac *pl330)
/* Detach the req */
descdone = thrd->req[active].desc;
if (descdone) {
if (!descdone->cyclic) {
thrd->req[active].desc = NULL;
thrd->req_running = -1;
/* Get going again ASAP */
_start(thrd);
}
if (!descdone->cyclic) {
thrd->req[active].desc = NULL;
thrd->req_running = -1;
/* Get going again ASAP */
_start(thrd);
/* For now, just make a list of callbacks to be done */
list_add_tail(&descdone->rqd, &pl330->req_done);
}
/* For now, just make a list of callbacks to be done */
list_add_tail(&descdone->rqd, &pl330->req_done);
}
}