Skip to content

Commit

Permalink
dmaengine: pl330: fix bug that chan descdone is null
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Huibin Hong authored and rkhuangtao committed Jan 29, 2018
1 parent 4e15e8d commit 636c30b
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions drivers/dma/pl330.c
Original file line number Diff line number Diff line change
Expand Up @@ -1785,16 +1785,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);
}
}

Expand Down

0 comments on commit 636c30b

Please sign in to comment.