aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma/fsldma.c
diff options
context:
space:
mode:
authorIra Snyder <iws@ovro.caltech.edu>2011-03-03 02:54:56 -0500
committerDan Williams <dan.j.williams@intel.com>2011-03-11 20:52:36 -0500
commit0ab09c36818ca88f65c88f4d8c6d067fbf10578d (patch)
tree0159493342cc6130ce8cdafe3cc568a80f25b2b1 /drivers/dma/fsldma.c
parentb158471ef63bf399165db96e945a828096502d9d (diff)
fsldma: improve link descriptor debugging
This adds better tracking to link descriptor allocations, callbacks, and frees. This makes it much easier to track errors with link descriptors. Signed-off-by: Ira W. Snyder <iws@ovro.caltech.edu> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/dma/fsldma.c')
-rw-r--r--drivers/dma/fsldma.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/drivers/dma/fsldma.c b/drivers/dma/fsldma.c
index e535cd13f7cc..82b8e9f9c7bf 100644
--- a/drivers/dma/fsldma.c
+++ b/drivers/dma/fsldma.c
@@ -420,6 +420,10 @@ static struct fsl_desc_sw *fsl_dma_alloc_descriptor(
420 desc->async_tx.tx_submit = fsl_dma_tx_submit; 420 desc->async_tx.tx_submit = fsl_dma_tx_submit;
421 desc->async_tx.phys = pdesc; 421 desc->async_tx.phys = pdesc;
422 422
423#ifdef FSL_DMA_LD_DEBUG
424 chan_dbg(chan, "LD %p allocated\n", desc);
425#endif
426
423 return desc; 427 return desc;
424} 428}
425 429
@@ -470,6 +474,9 @@ static void fsldma_free_desc_list(struct fsldma_chan *chan,
470 474
471 list_for_each_entry_safe(desc, _desc, list, node) { 475 list_for_each_entry_safe(desc, _desc, list, node) {
472 list_del(&desc->node); 476 list_del(&desc->node);
477#ifdef FSL_DMA_LD_DEBUG
478 chan_dbg(chan, "LD %p free\n", desc);
479#endif
473 dma_pool_free(chan->desc_pool, desc, desc->async_tx.phys); 480 dma_pool_free(chan->desc_pool, desc, desc->async_tx.phys);
474 } 481 }
475} 482}
@@ -481,6 +488,9 @@ static void fsldma_free_desc_list_reverse(struct fsldma_chan *chan,
481 488
482 list_for_each_entry_safe_reverse(desc, _desc, list, node) { 489 list_for_each_entry_safe_reverse(desc, _desc, list, node) {
483 list_del(&desc->node); 490 list_del(&desc->node);
491#ifdef FSL_DMA_LD_DEBUG
492 chan_dbg(chan, "LD %p free\n", desc);
493#endif
484 dma_pool_free(chan->desc_pool, desc, desc->async_tx.phys); 494 dma_pool_free(chan->desc_pool, desc, desc->async_tx.phys);
485 } 495 }
486} 496}
@@ -557,9 +567,6 @@ static struct dma_async_tx_descriptor *fsl_dma_prep_memcpy(
557 chan_err(chan, "%s\n", msg_ld_oom); 567 chan_err(chan, "%s\n", msg_ld_oom);
558 goto fail; 568 goto fail;
559 } 569 }
560#ifdef FSL_DMA_LD_DEBUG
561 chan_dbg(chan, "new link desc alloc %p\n", new);
562#endif
563 570
564 copy = min(len, (size_t)FSL_DMA_BCR_MAX_CNT); 571 copy = min(len, (size_t)FSL_DMA_BCR_MAX_CNT);
565 572
@@ -645,9 +652,6 @@ static struct dma_async_tx_descriptor *fsl_dma_prep_sg(struct dma_chan *dchan,
645 chan_err(chan, "%s\n", msg_ld_oom); 652 chan_err(chan, "%s\n", msg_ld_oom);
646 goto fail; 653 goto fail;
647 } 654 }
648#ifdef FSL_DMA_LD_DEBUG
649 chan_dbg(chan, "new link desc alloc %p\n", new);
650#endif
651 655
652 set_desc_cnt(chan, &new->hw, len); 656 set_desc_cnt(chan, &new->hw, len);
653 set_desc_src(chan, &new->hw, src); 657 set_desc_src(chan, &new->hw, src);
@@ -882,13 +886,18 @@ static void fsl_chan_ld_cleanup(struct fsldma_chan *chan)
882 callback_param = desc->async_tx.callback_param; 886 callback_param = desc->async_tx.callback_param;
883 if (callback) { 887 if (callback) {
884 spin_unlock_irqrestore(&chan->desc_lock, flags); 888 spin_unlock_irqrestore(&chan->desc_lock, flags);
889#ifdef FSL_DMA_LD_DEBUG
885 chan_dbg(chan, "LD %p callback\n", desc); 890 chan_dbg(chan, "LD %p callback\n", desc);
891#endif
886 callback(callback_param); 892 callback(callback_param);
887 spin_lock_irqsave(&chan->desc_lock, flags); 893 spin_lock_irqsave(&chan->desc_lock, flags);
888 } 894 }
889 895
890 /* Run any dependencies, then free the descriptor */ 896 /* Run any dependencies, then free the descriptor */
891 dma_run_dependencies(&desc->async_tx); 897 dma_run_dependencies(&desc->async_tx);
898#ifdef FSL_DMA_LD_DEBUG
899 chan_dbg(chan, "LD %p free\n", desc);
900#endif
892 dma_pool_free(chan->desc_pool, desc, desc->async_tx.phys); 901 dma_pool_free(chan->desc_pool, desc, desc->async_tx.phys);
893 } 902 }
894 903