aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma
diff options
context:
space:
mode:
authorJoel Fernandes <joelf@ti.com>2014-04-28 16:19:31 -0400
committerVinod Koul <vinod.koul@intel.com>2014-04-30 01:06:41 -0400
commit04361d887fc5d217bcb9cbd3c32980cdc34dc91f (patch)
treea31d694c24a00ffa670d454fb44613b0a2b5e57f /drivers/dma
parent740b41f7882162fc9339262b020757b741c4f1ac (diff)
dmaengine: edma: Document variables used for residue accounting
The granular residue accounting code uses certain variables specifically for residue accounting. Document these in the structure declaration. Also move around some elements and group them together. Cc: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Joel Fernandes <joelf@ti.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Diffstat (limited to 'drivers/dma')
-rw-r--r--drivers/dma/edma.c26
1 files changed, 24 insertions, 2 deletions
diff --git a/drivers/dma/edma.c b/drivers/dma/edma.c
index 5d9f57f27ffb..18c833fa1646 100644
--- a/drivers/dma/edma.c
+++ b/drivers/dma/edma.c
@@ -70,12 +70,34 @@ struct edma_desc {
70 int cyclic; 70 int cyclic;
71 int absync; 71 int absync;
72 int pset_nr; 72 int pset_nr;
73 struct edma_chan *echan;
73 int processed; 74 int processed;
75
76 /*
77 * The following 4 elements are used for residue accounting.
78 *
79 * - processed_stat: the number of SG elements we have traversed
80 * so far to cover accounting. This is updated directly to processed
81 * during edma_callback and is always <= processed, because processed
82 * refers to the number of pending transfer (programmed to EDMA
83 * controller), where as processed_stat tracks number of transfers
84 * accounted for so far.
85 *
86 * - residue: The amount of bytes we have left to transfer for this desc
87 *
88 * - residue_stat: The residue in bytes of data we have covered
89 * so far for accounting. This is updated directly to residue
90 * during callbacks to keep it current.
91 *
92 * - sg_len: Tracks the length of the current intermediate transfer,
93 * this is required to update the residue during intermediate transfer
94 * completion callback.
95 */
74 int processed_stat; 96 int processed_stat;
75 u32 residue;
76 u32 sg_len; 97 u32 sg_len;
98 u32 residue;
77 u32 residue_stat; 99 u32 residue_stat;
78 struct edma_chan *echan; 100
79 struct edma_pset pset[0]; 101 struct edma_pset pset[0];
80}; 102};
81 103