public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] dmaengine: edma: Document variables used for residue accounting
@ 2014-04-28 20:48 Joel Fernandes
       [not found] ` <1398718128-22647-1-git-send-email-joelf-l0cyMroinI0@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Joel Fernandes @ 2014-04-28 20:48 UTC (permalink / raw)
  To: Sekhar Nori, Matt Porter, Vinod Koul, Dan Williams
  Cc: Linux DaVinci Kernel List, Joel Fernandes,
	Linux Kernel Mailing List, Thomas Gleixner, Linux OMAP List,
	Linux ARM Kernel List

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-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>
Signed-off-by: Joel Fernandes <joelf-l0cyMroinI0@public.gmane.org>
---
 drivers/dma/edma.c |   26 ++++++++++++++++++++++++--
 1 file changed, 24 insertions(+), 2 deletions(-)

diff --git a/drivers/dma/edma.c b/drivers/dma/edma.c
index 4c574f60..8926078 100644
--- a/drivers/dma/edma.c
+++ b/drivers/dma/edma.c
@@ -70,12 +70,34 @@ struct edma_desc {
 	int				cyclic;
 	int				absync;
 	int				pset_nr;
+	struct edma_chan		*echan;
 	int				processed;
+
+	/*
+	 * The following 4 elements are used for residue accounting.
+	 *
+	 * - processed_stat: the number of SG elements we have traversed
+	 * so far to cover accounting. This is updated directly to processed
+	 * during edma_callback and is always <= processed, because processed
+	 * refers to the number of pending transfer (programmed to EDMA
+	 * controller), where as processed_stat tracks number of transfers
+	 * accounted for so far.
+	 *
+	 * - residue: The amount of bytes we have left to transfer for this desc
+	 *
+	 * - residue_stat: The residue in bytes of data we have covered
+	 * so far for accounting. This is updated directly to residue
+	 * during callbacks to keep it current.
+	 *
+	 * - sg_len: Tracks the length of the current intermediate transfer,
+	 * this is required to update the residue during intermediate transfer
+	 * completion callback.
+	 */
 	int				processed_stat;
-	u32				residue;
 	u32				sg_len;
+	u32				residue;
 	u32				residue_stat;
-	struct edma_chan		*echan;
+
 	struct edma_pset		pset[0];
 };
 
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH 2/2] dmaengine: edma: update DMA memcpy to use new param element
       [not found] ` <1398718128-22647-1-git-send-email-joelf-l0cyMroinI0@public.gmane.org>
@ 2014-04-28 20:48   ` Joel Fernandes
  0 siblings, 0 replies; 2+ messages in thread
From: Joel Fernandes @ 2014-04-28 20:48 UTC (permalink / raw)
  To: Sekhar Nori, Matt Porter, Vinod Koul, Dan Williams
  Cc: Linux DaVinci Kernel List, Joel Fernandes,
	Linux Kernel Mailing List, Thomas Gleixner, Linux OMAP List,
	Linux ARM Kernel List

edma param struct is now within an edma_pset struct introduced in Thomas
Gleixner's edma tx status series. Update memcpy function for the same.

Cc: Thomas Gleixner <tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>
Signed-off-by: Joel Fernandes <joelf-l0cyMroinI0@public.gmane.org>
---
 drivers/dma/edma.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/dma/edma.c b/drivers/dma/edma.c
index 8926078..ec9c410 100644
--- a/drivers/dma/edma.c
+++ b/drivers/dma/edma.c
@@ -582,8 +582,8 @@ struct dma_async_tx_descriptor *edma_prep_dma_memcpy(
 	 * on completion of every TR, and enable transfer-completion
 	 * interrupt on completion of the whole transfer.
 	 */
-	edesc->pset[0].opt |= ITCCHEN;
-	edesc->pset[0].opt |= TCINTEN;
+	edesc->pset[0].param.opt |= ITCCHEN;
+	edesc->pset[0].param.opt |= TCINTEN;
 
 	return vchan_tx_prep(&echan->vchan, &edesc->vdesc, tx_flags);
 }
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-04-28 20:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-28 20:48 [PATCH 1/2] dmaengine: edma: Document variables used for residue accounting Joel Fernandes
     [not found] ` <1398718128-22647-1-git-send-email-joelf-l0cyMroinI0@public.gmane.org>
2014-04-28 20:48   ` [PATCH 2/2] dmaengine: edma: update DMA memcpy to use new param element Joel Fernandes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox