If there's an error, reschedule the descriptor by adding it
back to submitted descriptor. If there's already pending or
submitted descriptor, drop and free the error descriptor properly.
Previously, the dropped descriptor wasn't freed properly.
Reported-by: Varunkumar Allagadapa <varunkum@xilinx.com>
Signed-off-by: Hyun Kwon <hyun.kwon@xilinx.com>
Tested-by: Varunkumar Allagadapa <varunkum@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
case ACTIVE:
case PREPARED:
/* Reschedule if there's no new descriptor */
- if (!chan->submitted_desc)
+ if (!chan->pending_desc && !chan->submitted_desc) {
+ chan->active_desc->status = ERRORED;
chan->submitted_desc = chan->active_desc;
- chan->active_desc->status = ERRORED;
+ } else {
+ xilinx_dpdma_chan_free_tx_desc(chan, chan->active_desc);
+ }
break;
}
chan->active_desc = NULL;