linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joel Fernandes <joelf@ti.com>
To: Sekhar Nori <nsekhar@ti.com>, Matt Porter <matt@ohporter.com>,
	Vinod Koul <vinod.koul@intel.com>, Dan Williams <djbw@fb.com>,
	Russell King <linux@arm.linux.org.uk>,
	Sricharan R <r.sricharan@ti.com>
Cc: Linux OMAP List <linux-omap@vger.kernel.org>,
	Linux ARM Kernel List <linux-arm-kernel@lists.infradead.org>,
	Linux DaVinci Kernel List 
	<davinci-linux-open-source@linux.davincidsp.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux MMC List <linux-mmc@vger.kernel.org>,
	Koen Kooi <koen@dominion.thruhere.net>,
	Franklin Cooper <fcooper@ti.com>, Joel Fernandes <joelf@ti.com>
Subject: [PATCH v4 5/6] dma: edma: Leave linked to Null slot instead of DUMMY slot
Date: Thu, 29 Aug 2013 18:05:44 -0500	[thread overview]
Message-ID: <1377817545-18015-6-git-send-email-joelf@ti.com> (raw)
In-Reply-To: <1377817545-18015-1-git-send-email-joelf@ti.com>

Dummy slot has been used as a way for missed-events not to be
reported as missing. This has been particularly troublesome for cases
where we might want to temporarily pause all incoming events.

For EDMA DMAC, there is no way to do any such pausing of events as
the occurence of the "next" event is not software controlled.
Using "edma_pause" in IRQ handlers doesn't help as by then the event
in concern from the slave is already missed.

Linking a dummy slot, is seen to absorb these events which we didn't
want to miss. So we don't link to dummy, but instead leave it linked
to NULL set, allow an error condition and detect the channel that
missed it.

Signed-off-by: Joel Fernandes <joelf@ti.com>

dma: edma: Link to dummy slot only for last SG list split

Consider the case where we have a scatter-list like:
SG1->SG2->SG3->SG4->SG5->SG6->Null

For ex, for a MAX_NR_SG of 2, earlier we were splitting this as:
SG1->SG2->Null
SG3->SG4->Null
SG5->SG6->Null

Now we split it as
SG1->SG2->Null
SG3->SG4->Null
SG5->SG6->Dummy

This approach results in lesser unwanted interrupts that occur
for the last list split. The Dummy slot has the property of not
raising an error condition if events are missed unlike the Null
slot. We are OK with this as we're done with processing the
whole list once we reach Dummy.

Signed-off-by: Joel Fernandes <joelf@ti.com>
---
 drivers/dma/edma.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/dma/edma.c b/drivers/dma/edma.c
index 0e77b57..25e47d4 100644
--- a/drivers/dma/edma.c
+++ b/drivers/dma/edma.c
@@ -158,13 +158,18 @@ static void edma_execute(struct edma_chan *echan)
 		/* Link to the previous slot if not the last set */
 		if (i != (nslots - 1))
 			edma_link(echan->slot[i], echan->slot[i+1]);
-		/* Final pset links to the dummy pset */
-		else
-			edma_link(echan->slot[i], echan->ecc->dummy_slot);
 	}
 
 	edesc->processed += nslots;
 
+	/*
+	 * If this is either the last set in a set of SG-list transactions
+	 * then setup a link to the dummy slot, this results in all future
+	 * events being absorbed and that's OK because we're done
+	 */
+	if (edesc->processed == edesc->pset_nr)
+		edma_link(echan->slot[nslots-1], echan->ecc->dummy_slot);
+
 	edma_resume(echan->ch_num);
 
 	if (edesc->processed <= MAX_NR_SG) {
-- 
1.8.1.2


  parent reply	other threads:[~2013-08-29 23:06 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-29 23:05 [PATCH v4 0/6] dma: edma: Support scatter-lists of any length Joel Fernandes
2013-08-29 23:05 ` [PATCH v4 1/6] dma: edma: Setup parameters to DMA MAX_NR_SG at a time Joel Fernandes
2013-08-29 23:05 ` [PATCH v4 2/6] dma: edma: Write out and handle MAX_NR_SG at a given time Joel Fernandes
2013-09-03  4:08   ` Vinod Koul
2013-09-03 15:02     ` Joel Fernandes
2013-08-29 23:05 ` [PATCH v4 3/6] ARM: edma: Add function to manually trigger an EDMA channel Joel Fernandes
2013-09-02 14:08   ` Sekhar Nori
2013-08-29 23:05 ` [PATCH v4 4/6] dma: edma: Find missed events and issue them Joel Fernandes
2013-08-29 23:05 ` Joel Fernandes [this message]
2013-08-29 23:05 ` [PATCH v4 6/6] dma: edma: Remove limits on number of slots Joel Fernandes
2013-09-02 11:59 ` [PATCH v4 0/6] dma: edma: Support scatter-lists of any length Vinod Koul

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1377817545-18015-6-git-send-email-joelf@ti.com \
    --to=joelf@ti.com \
    --cc=davinci-linux-open-source@linux.davincidsp.com \
    --cc=djbw@fb.com \
    --cc=fcooper@ti.com \
    --cc=koen@dominion.thruhere.net \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=matt@ohporter.com \
    --cc=nsekhar@ti.com \
    --cc=r.sricharan@ti.com \
    --cc=vinod.koul@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).