linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Ujfalusi <peter.ujfalusi@ti.com>
To: <vinod.koul@intel.com>, <tony@atomide.com>, <linux@arm.linux.org.uk>
Cc: <grant.likely@linaro.org>, <dmaengine@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <devicetree@vger.kernel.org>,
	<linux-omap@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>, <robh+dt@kernel.org>,
	<nm@ti.com>, <arnd@arndb.de>, <maxime.ripard@free-electrons.com>
Subject: [PATCH v5 6/8] dmaengine: omap-dma: Remove mapping between virtual channels and requests
Date: Thu, 9 Apr 2015 12:35:52 +0300	[thread overview]
Message-ID: <1428572154-3548-7-git-send-email-peter.ujfalusi@ti.com> (raw)
In-Reply-To: <1428572154-3548-1-git-send-email-peter.ujfalusi@ti.com>

Do not direct map the virtual channels to sDMA request number. When the
sDMA is behind of a crossbar this direct mapping can cause situations when
certain channel can not be requested since the crossbar request number
will no longer match with the sDMA request line.
The direct mapping for virtual channels with HW request lines will make it
harder to implement MEM_TO_MEM mode for the driver.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
 drivers/dma/omap-dma.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/dma/omap-dma.c b/drivers/dma/omap-dma.c
index 211c9c1edf08..b19b9ee8f1d1 100644
--- a/drivers/dma/omap-dma.c
+++ b/drivers/dma/omap-dma.c
@@ -593,6 +593,7 @@ static void omap_dma_free_chan_resources(struct dma_chan *chan)
 	omap_free_dma(c->dma_ch);
 
 	dev_dbg(od->ddev.dev, "freeing channel for %u\n", c->dma_sig);
+	c->dma_sig = 0;
 }
 
 static size_t omap_dma_sg_size(struct omap_sg *sg)
@@ -1041,7 +1042,7 @@ static int omap_dma_resume(struct dma_chan *chan)
 	return 0;
 }
 
-static int omap_dma_chan_init(struct omap_dmadev *od, int dma_sig)
+static int omap_dma_chan_init(struct omap_dmadev *od)
 {
 	struct omap_chan *c;
 
@@ -1050,7 +1051,6 @@ static int omap_dma_chan_init(struct omap_dmadev *od, int dma_sig)
 		return -ENOMEM;
 
 	c->reg_map = od->reg_map;
-	c->dma_sig = dma_sig;
 	c->vc.desc_free = omap_dma_desc_free;
 	vchan_init(&c->vc, &od->ddev);
 	INIT_LIST_HEAD(&c->node);
@@ -1130,7 +1130,7 @@ static int omap_dma_probe(struct platform_device *pdev)
 	}
 
 	for (i = 0; i < od->dma_requests; i++) {
-		rc = omap_dma_chan_init(od, i);
+		rc = omap_dma_chan_init(od);
 		if (rc) {
 			omap_dma_free(od);
 			return rc;
@@ -1221,10 +1221,14 @@ static struct platform_driver omap_dma_driver = {
 bool omap_dma_filter_fn(struct dma_chan *chan, void *param)
 {
 	if (chan->device->dev->driver == &omap_dma_driver.driver) {
+		struct omap_dmadev *od = to_omap_dma_dev(chan->device);
 		struct omap_chan *c = to_omap_dma_chan(chan);
 		unsigned req = *(unsigned *)param;
 
-		return req == c->dma_sig;
+		if (req <= od->dma_requests) {
+			c->dma_sig = req;
+			return true;
+		}
 	}
 	return false;
 }
-- 
2.3.5


  parent reply	other threads:[~2015-04-09  9:37 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-09  9:35 [PATCH v5 0/8] dmaengine/dra7x: DMA router (crossbar support) Peter Ujfalusi
2015-04-09  9:35 ` [PATCH v5 1/8] dmaengine: of_dma: Support for DMA routers Peter Ujfalusi
2015-04-09  9:35 ` [PATCH v5 2/8] Documentation: devicetree: dma: Binding documentation for TI DMA crossbar Peter Ujfalusi
2015-04-09  9:35 ` [PATCH v5 3/8] dmaengine: Add driver for TI DMA crossbar on DRA7x Peter Ujfalusi
2015-05-04  5:38   ` Vinod Koul
2015-05-07  9:48     ` Peter Ujfalusi
2015-05-08  3:41       ` Vinod Koul
2015-05-08  7:05         ` Peter Ujfalusi
2015-05-08  9:03           ` Vinod Koul
2015-05-08 15:09             ` Tony Lindgren
2015-05-08 17:44               ` Peter Ujfalusi
2015-04-09  9:35 ` [PATCH v5 4/8] dmaengine: omap-dma: Use defines for dma channels and request count Peter Ujfalusi
2015-04-09  9:35 ` [PATCH v5 5/8] dmaengine: omap-dma: Take DMA request number from DT if it is available Peter Ujfalusi
2015-04-09  9:35 ` Peter Ujfalusi [this message]
2015-04-09  9:35 ` [PATCH v5 7/8] dmaengine: omap-dma: Reduce the number of virtual channels Peter Ujfalusi
2015-04-09  9:35 ` [PATCH v5 8/8] ARM: DTS: dra7x: Integrate sDMA crossbar Peter Ujfalusi
2015-04-09 15:18   ` Tony Lindgren
2015-04-09 18:50     ` Peter Ujfalusi
2015-04-09 19:01       ` Tony Lindgren
2015-04-09 19:05         ` Peter Ujfalusi
2015-04-09 19:12           ` Tony Lindgren
2015-07-14 10:28             ` Tony Lindgren
2015-05-04  5:40   ` Vinod Koul
2015-04-22  7:38 ` [PATCH v5 0/8] dmaengine/dra7x: DMA router (crossbar support) Peter Ujfalusi
2015-05-09 11:44 ` Vinod Koul
2015-05-13 14:57   ` Peter Ujfalusi
2015-05-14 15:21     ` 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=1428572154-3548-7-git-send-email-peter.ujfalusi@ti.com \
    --to=peter.ujfalusi@ti.com \
    --cc=arnd@arndb.de \
    --cc=devicetree@vger.kernel.org \
    --cc=dmaengine@vger.kernel.org \
    --cc=grant.likely@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=maxime.ripard@free-electrons.com \
    --cc=nm@ti.com \
    --cc=robh+dt@kernel.org \
    --cc=tony@atomide.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).