Skip to content

Commit a63ddc3

Browse files
larsclausenvinodkoul
authored andcommitted
dmaengine: xilinx_dma: Correctly handle cyclic descriptor callbacks
DMA clients can provide one of two types of callbacks. For this reason dmaengine drivers should not directly invoke `callback`, but always use `dmaengine_desc_callback_invoke()`. This makes sure that both types of callbacks are handled correctly. The xilinx_dma driver currently doesn't do this for cyclic descriptors and only handles the `callback` type callback. If the client used the `callback_result` type callback it will not be called. Fix this by switching to `dmaengine_desc_callback_valid()` and `dmaengine_desc_callback_invoke()`. Signed-off-by: Lars-Peter Clausen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent a34da7e commit a63ddc3

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

drivers/dma/xilinx/xilinx_dma.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -998,14 +998,12 @@ static void xilinx_dma_chan_handle_cyclic(struct xilinx_dma_chan *chan,
998998
struct xilinx_dma_tx_descriptor *desc,
999999
unsigned long *flags)
10001000
{
1001-
dma_async_tx_callback callback;
1002-
void *callback_param;
1001+
struct dmaengine_desc_callback cb;
10031002

1004-
callback = desc->async_tx.callback;
1005-
callback_param = desc->async_tx.callback_param;
1006-
if (callback) {
1003+
dmaengine_desc_get_callback(&desc->async_tx, &cb);
1004+
if (dmaengine_desc_callback_valid(&cb)) {
10071005
spin_unlock_irqrestore(&chan->lock, *flags);
1008-
callback(callback_param);
1006+
dmaengine_desc_callback_invoke(&cb, NULL);
10091007
spin_lock_irqsave(&chan->lock, *flags);
10101008
}
10111009
}

0 commit comments

Comments
 (0)