Skip to content

Commit

Permalink
dmaengine: omap-dma: Remove mapping between virtual channels and requ…
Browse files Browse the repository at this point in the history
…ests

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>
  • Loading branch information
Peter Ujfalusi authored and Vinod Koul committed May 9, 2015
1 parent de50608 commit eea531e
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions drivers/dma/omap-dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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;

Expand All @@ -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);
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit eea531e

Please sign in to comment.