]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - android-sdk/kernel-video.git/commitdiff
dmaengine: omap-dma: Remove mapping between virtual channels and requests
authorPeter Ujfalusi <peter.ujfalusi@ti.com>
Thu, 9 Apr 2015 09:35:52 +0000 (12:35 +0300)
committerMisael Lopez Cruz <misael.lopez@ti.com>
Thu, 4 Jun 2015 20:59:51 +0000 (15:59 -0500)
[ Upstream commit eea531ea4147f60708c7ee9e53b5735ec387adb6 ]

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>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
drivers/dma/omap-dma.c

index 4ff9f5864808af776560d3494a77056b3bcf6279..ee91cbf4f050970a0f9ae6231cde6d3f13e5305d 100644 (file)
@@ -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)
@@ -1073,7 +1074,7 @@ static int omap_dma_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd,
        return ret;
 }
 
-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;
 
@@ -1082,7 +1083,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);
@@ -1171,7 +1171,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;
@@ -1263,10 +1263,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;
 }