Commit 75c53188 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'fixes' of git://git.infradead.org/users/vkoul/slave-dma

Pull slave-dmaengine fixes from Vinod Koul:
 "Another week, time to send another fixes request taking time out of
  extended weekend for the festivities in this part of the world.

  We have two fixes from Sergei for rcar driver and one fixing memory
  leak of edma driver by Geyslan"

* 'fixes' of git://git.infradead.org/users/vkoul/slave-dma:
  dma: edma.c: remove edma_desc leakage
  rcar-hpbdma: add parameter to set_slave() method
  rcar-hpbdma: remove shdma_free_irq() calls
parents 9d05746e 2f6d8fad
...@@ -306,6 +306,7 @@ static struct dma_async_tx_descriptor *edma_prep_slave_sg( ...@@ -306,6 +306,7 @@ static struct dma_async_tx_descriptor *edma_prep_slave_sg(
EDMA_SLOT_ANY); EDMA_SLOT_ANY);
if (echan->slot[i] < 0) { if (echan->slot[i] < 0) {
dev_err(dev, "Failed to allocate slot\n"); dev_err(dev, "Failed to allocate slot\n");
kfree(edesc);
return NULL; return NULL;
} }
} }
......
...@@ -93,6 +93,7 @@ struct hpb_dmae_chan { ...@@ -93,6 +93,7 @@ struct hpb_dmae_chan {
void __iomem *base; void __iomem *base;
const struct hpb_dmae_slave_config *cfg; const struct hpb_dmae_slave_config *cfg;
char dev_id[16]; /* unique name per DMAC of channel */ char dev_id[16]; /* unique name per DMAC of channel */
dma_addr_t slave_addr;
}; };
struct hpb_dmae_device { struct hpb_dmae_device {
...@@ -432,7 +433,6 @@ hpb_dmae_alloc_chan_resources(struct hpb_dmae_chan *hpb_chan, ...@@ -432,7 +433,6 @@ hpb_dmae_alloc_chan_resources(struct hpb_dmae_chan *hpb_chan,
hpb_chan->xfer_mode = XFER_DOUBLE; hpb_chan->xfer_mode = XFER_DOUBLE;
} else { } else {
dev_err(hpb_chan->shdma_chan.dev, "DCR setting error"); dev_err(hpb_chan->shdma_chan.dev, "DCR setting error");
shdma_free_irq(&hpb_chan->shdma_chan);
return -EINVAL; return -EINVAL;
} }
...@@ -446,7 +446,8 @@ hpb_dmae_alloc_chan_resources(struct hpb_dmae_chan *hpb_chan, ...@@ -446,7 +446,8 @@ hpb_dmae_alloc_chan_resources(struct hpb_dmae_chan *hpb_chan,
return 0; return 0;
} }
static int hpb_dmae_set_slave(struct shdma_chan *schan, int slave_id, bool try) static int hpb_dmae_set_slave(struct shdma_chan *schan, int slave_id,
dma_addr_t slave_addr, bool try)
{ {
struct hpb_dmae_chan *chan = to_chan(schan); struct hpb_dmae_chan *chan = to_chan(schan);
const struct hpb_dmae_slave_config *sc = const struct hpb_dmae_slave_config *sc =
...@@ -457,6 +458,7 @@ static int hpb_dmae_set_slave(struct shdma_chan *schan, int slave_id, bool try) ...@@ -457,6 +458,7 @@ static int hpb_dmae_set_slave(struct shdma_chan *schan, int slave_id, bool try)
if (try) if (try)
return 0; return 0;
chan->cfg = sc; chan->cfg = sc;
chan->slave_addr = slave_addr ? : sc->addr;
return hpb_dmae_alloc_chan_resources(chan, sc); return hpb_dmae_alloc_chan_resources(chan, sc);
} }
...@@ -468,7 +470,7 @@ static dma_addr_t hpb_dmae_slave_addr(struct shdma_chan *schan) ...@@ -468,7 +470,7 @@ static dma_addr_t hpb_dmae_slave_addr(struct shdma_chan *schan)
{ {
struct hpb_dmae_chan *chan = to_chan(schan); struct hpb_dmae_chan *chan = to_chan(schan);
return chan->cfg->addr; return chan->slave_addr;
} }
static struct shdma_desc *hpb_dmae_embedded_desc(void *buf, int i) static struct shdma_desc *hpb_dmae_embedded_desc(void *buf, int i)
...@@ -614,7 +616,6 @@ static void hpb_dmae_chan_remove(struct hpb_dmae_device *hpbdev) ...@@ -614,7 +616,6 @@ static void hpb_dmae_chan_remove(struct hpb_dmae_device *hpbdev)
shdma_for_each_chan(schan, &hpbdev->shdma_dev, i) { shdma_for_each_chan(schan, &hpbdev->shdma_dev, i) {
BUG_ON(!schan); BUG_ON(!schan);
shdma_free_irq(schan);
shdma_chan_remove(schan); shdma_chan_remove(schan);
} }
dma_dev->chancnt = 0; dma_dev->chancnt = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment