Commit 2187c269ad29510f1d65ec684133d1d3426d0eed
Committed by
Dan Williams
1 parent
9b941c6660
fsldma: Add device_prep_dma_interrupt support to fsldma.c
This is a bug that I assigned DMA_INTERRUPT capability to fsldma but missing device_prep_dma_interrupt function. For a bug in dmaengine.c the driver passed BUG_ON() checking. The patch fixes it. Signed-off-by: Zhang Wei <wei.zhang@freescale.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Showing 1 changed file with 27 additions and 0 deletions Side-by-side Diff
drivers/dma/fsldma.c
... | ... | @@ -406,6 +406,32 @@ |
406 | 406 | dma_pool_destroy(fsl_chan->desc_pool); |
407 | 407 | } |
408 | 408 | |
409 | +static struct dma_async_tx_descriptor * | |
410 | +fsl_dma_prep_interrupt(struct dma_chan *chan) | |
411 | +{ | |
412 | + struct fsl_dma_chan *fsl_chan; | |
413 | + struct fsl_desc_sw *new; | |
414 | + | |
415 | + if (!chan) | |
416 | + return NULL; | |
417 | + | |
418 | + fsl_chan = to_fsl_chan(chan); | |
419 | + | |
420 | + new = fsl_dma_alloc_descriptor(fsl_chan); | |
421 | + if (!new) { | |
422 | + dev_err(fsl_chan->dev, "No free memory for link descriptor\n"); | |
423 | + return NULL; | |
424 | + } | |
425 | + | |
426 | + new->async_tx.cookie = -EBUSY; | |
427 | + new->async_tx.ack = 0; | |
428 | + | |
429 | + /* Set End-of-link to the last link descriptor of new list*/ | |
430 | + set_ld_eol(fsl_chan, new); | |
431 | + | |
432 | + return &new->async_tx; | |
433 | +} | |
434 | + | |
409 | 435 | static struct dma_async_tx_descriptor *fsl_dma_prep_memcpy( |
410 | 436 | struct dma_chan *chan, dma_addr_t dma_dest, dma_addr_t dma_src, |
411 | 437 | size_t len, unsigned long flags) |
... | ... | @@ -1020,6 +1046,7 @@ |
1020 | 1046 | dma_cap_set(DMA_INTERRUPT, fdev->common.cap_mask); |
1021 | 1047 | fdev->common.device_alloc_chan_resources = fsl_dma_alloc_chan_resources; |
1022 | 1048 | fdev->common.device_free_chan_resources = fsl_dma_free_chan_resources; |
1049 | + fdev->common.device_prep_dma_interrupt = fsl_dma_prep_interrupt; | |
1023 | 1050 | fdev->common.device_prep_dma_memcpy = fsl_dma_prep_memcpy; |
1024 | 1051 | fdev->common.device_is_tx_complete = fsl_dma_is_complete; |
1025 | 1052 | fdev->common.device_issue_pending = fsl_dma_memcpy_issue_pending; |