Commit acdf2fc8 authored by Linus Torvalds's avatar Linus Torvalds

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

Pull [GIT PULL] slave-dmaengine fixes from Vinod Koul.

* 'fixes' of git://git.infradead.org/users/vkoul/slave-dma:
  dmaengine/amba-pl08x : reset phychan_hold on terminate all
  dma: pl330: fix a couple of compilation warnings
  dma/ste_dma40: fix erroneous comparison
  dma/ste_dma40: explicitly include regulator consumer header
  dma40: Improve the logic of stopping logical chan
  dmaengine: at_hdmac: remove clear-on-read in atc_dostart()
  dma: mxs-dma: enable channel in device_issue_pending call
  dmaengine: imx-dma: dont complete descriptor for cyclic dma
parents 2390c0fc 88c08a3f
...@@ -1429,6 +1429,7 @@ static int pl08x_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd, ...@@ -1429,6 +1429,7 @@ static int pl08x_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd,
* signal * signal
*/ */
release_phy_channel(plchan); release_phy_channel(plchan);
plchan->phychan_hold = 0;
} }
/* Dequeue jobs and free LLIs */ /* Dequeue jobs and free LLIs */
if (plchan->at) { if (plchan->at) {
......
...@@ -221,10 +221,6 @@ static void atc_dostart(struct at_dma_chan *atchan, struct at_desc *first) ...@@ -221,10 +221,6 @@ static void atc_dostart(struct at_dma_chan *atchan, struct at_desc *first)
vdbg_dump_regs(atchan); vdbg_dump_regs(atchan);
/* clear any pending interrupt */
while (dma_readl(atdma, EBCISR))
cpu_relax();
channel_writel(atchan, SADDR, 0); channel_writel(atchan, SADDR, 0);
channel_writel(atchan, DADDR, 0); channel_writel(atchan, DADDR, 0);
channel_writel(atchan, CTRLA, 0); channel_writel(atchan, CTRLA, 0);
......
...@@ -571,11 +571,14 @@ static void imxdma_tasklet(unsigned long data) ...@@ -571,11 +571,14 @@ static void imxdma_tasklet(unsigned long data)
if (desc->desc.callback) if (desc->desc.callback)
desc->desc.callback(desc->desc.callback_param); desc->desc.callback(desc->desc.callback_param);
dma_cookie_complete(&desc->desc); /* If we are dealing with a cyclic descriptor keep it on ld_active
* and dont mark the descripor as complete.
/* If we are dealing with a cyclic descriptor keep it on ld_active */ * Only in non-cyclic cases it would be marked as complete
*/
if (imxdma_chan_is_doing_cyclic(imxdmac)) if (imxdma_chan_is_doing_cyclic(imxdmac))
goto out; goto out;
else
dma_cookie_complete(&desc->desc);
/* Free 2D slot if it was an interleaved transfer */ /* Free 2D slot if it was an interleaved transfer */
if (imxdmac->enabled_2d) { if (imxdmac->enabled_2d) {
......
...@@ -201,10 +201,6 @@ static struct mxs_dma_chan *to_mxs_dma_chan(struct dma_chan *chan) ...@@ -201,10 +201,6 @@ static struct mxs_dma_chan *to_mxs_dma_chan(struct dma_chan *chan)
static dma_cookie_t mxs_dma_tx_submit(struct dma_async_tx_descriptor *tx) static dma_cookie_t mxs_dma_tx_submit(struct dma_async_tx_descriptor *tx)
{ {
struct mxs_dma_chan *mxs_chan = to_mxs_dma_chan(tx->chan);
mxs_dma_enable_chan(mxs_chan);
return dma_cookie_assign(tx); return dma_cookie_assign(tx);
} }
...@@ -558,9 +554,9 @@ static enum dma_status mxs_dma_tx_status(struct dma_chan *chan, ...@@ -558,9 +554,9 @@ static enum dma_status mxs_dma_tx_status(struct dma_chan *chan,
static void mxs_dma_issue_pending(struct dma_chan *chan) static void mxs_dma_issue_pending(struct dma_chan *chan)
{ {
/* struct mxs_dma_chan *mxs_chan = to_mxs_dma_chan(chan);
* Nothing to do. We only have a single descriptor.
*/ mxs_dma_enable_chan(mxs_chan);
} }
static int __init mxs_dma_init(struct mxs_dma_engine *mxs_dma) static int __init mxs_dma_init(struct mxs_dma_engine *mxs_dma)
......
...@@ -2225,12 +2225,9 @@ static inline void free_desc_list(struct list_head *list) ...@@ -2225,12 +2225,9 @@ static inline void free_desc_list(struct list_head *list)
{ {
struct dma_pl330_dmac *pdmac; struct dma_pl330_dmac *pdmac;
struct dma_pl330_desc *desc; struct dma_pl330_desc *desc;
struct dma_pl330_chan *pch; struct dma_pl330_chan *pch = NULL;
unsigned long flags; unsigned long flags;
if (list_empty(list))
return;
/* Finish off the work list */ /* Finish off the work list */
list_for_each_entry(desc, list, node) { list_for_each_entry(desc, list, node) {
dma_async_tx_callback callback; dma_async_tx_callback callback;
...@@ -2247,6 +2244,10 @@ static inline void free_desc_list(struct list_head *list) ...@@ -2247,6 +2244,10 @@ static inline void free_desc_list(struct list_head *list)
desc->pchan = NULL; desc->pchan = NULL;
} }
/* pch will be unset if list was empty */
if (!pch)
return;
pdmac = pch->dmac; pdmac = pch->dmac;
spin_lock_irqsave(&pdmac->pool_lock, flags); spin_lock_irqsave(&pdmac->pool_lock, flags);
...@@ -2257,12 +2258,9 @@ static inline void free_desc_list(struct list_head *list) ...@@ -2257,12 +2258,9 @@ static inline void free_desc_list(struct list_head *list)
static inline void handle_cyclic_desc_list(struct list_head *list) static inline void handle_cyclic_desc_list(struct list_head *list)
{ {
struct dma_pl330_desc *desc; struct dma_pl330_desc *desc;
struct dma_pl330_chan *pch; struct dma_pl330_chan *pch = NULL;
unsigned long flags; unsigned long flags;
if (list_empty(list))
return;
list_for_each_entry(desc, list, node) { list_for_each_entry(desc, list, node) {
dma_async_tx_callback callback; dma_async_tx_callback callback;
...@@ -2274,6 +2272,10 @@ static inline void handle_cyclic_desc_list(struct list_head *list) ...@@ -2274,6 +2272,10 @@ static inline void handle_cyclic_desc_list(struct list_head *list)
callback(desc->txd.callback_param); callback(desc->txd.callback_param);
} }
/* pch will be unset if list was empty */
if (!pch)
return;
spin_lock_irqsave(&pch->lock, flags); spin_lock_irqsave(&pch->lock, flags);
list_splice_tail_init(list, &pch->work_list); list_splice_tail_init(list, &pch->work_list);
spin_unlock_irqrestore(&pch->lock, flags); spin_unlock_irqrestore(&pch->lock, flags);
...@@ -2926,8 +2928,11 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id) ...@@ -2926,8 +2928,11 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id)
INIT_LIST_HEAD(&pd->channels); INIT_LIST_HEAD(&pd->channels);
/* Initialize channel parameters */ /* Initialize channel parameters */
num_chan = max(pdat ? pdat->nr_valid_peri : (u8)pi->pcfg.num_peri, if (pdat)
(u8)pi->pcfg.num_chan); num_chan = max_t(int, pdat->nr_valid_peri, pi->pcfg.num_chan);
else
num_chan = max_t(int, pi->pcfg.num_peri, pi->pcfg.num_chan);
pdmac->peripherals = kzalloc(num_chan * sizeof(*pch), GFP_KERNEL); pdmac->peripherals = kzalloc(num_chan * sizeof(*pch), GFP_KERNEL);
for (i = 0; i < num_chan; i++) { for (i = 0; i < num_chan; i++) {
......
This diff is collapsed.
...@@ -62,8 +62,6 @@ ...@@ -62,8 +62,6 @@
#define D40_SREG_ELEM_LOG_LIDX_MASK (0xFF << D40_SREG_ELEM_LOG_LIDX_POS) #define D40_SREG_ELEM_LOG_LIDX_MASK (0xFF << D40_SREG_ELEM_LOG_LIDX_POS)
/* Link register */ /* Link register */
#define D40_DEACTIVATE_EVENTLINE 0x0
#define D40_ACTIVATE_EVENTLINE 0x1
#define D40_EVENTLINE_POS(i) (2 * i) #define D40_EVENTLINE_POS(i) (2 * i)
#define D40_EVENTLINE_MASK(i) (0x3 << D40_EVENTLINE_POS(i)) #define D40_EVENTLINE_MASK(i) (0x3 << D40_EVENTLINE_POS(i))
......
...@@ -363,6 +363,7 @@ static void mxs_mmc_bc(struct mxs_mmc_host *host) ...@@ -363,6 +363,7 @@ static void mxs_mmc_bc(struct mxs_mmc_host *host)
goto out; goto out;
dmaengine_submit(desc); dmaengine_submit(desc);
dma_async_issue_pending(host->dmach);
return; return;
out: out:
...@@ -403,6 +404,7 @@ static void mxs_mmc_ac(struct mxs_mmc_host *host) ...@@ -403,6 +404,7 @@ static void mxs_mmc_ac(struct mxs_mmc_host *host)
goto out; goto out;
dmaengine_submit(desc); dmaengine_submit(desc);
dma_async_issue_pending(host->dmach);
return; return;
out: out:
...@@ -531,6 +533,7 @@ static void mxs_mmc_adtc(struct mxs_mmc_host *host) ...@@ -531,6 +533,7 @@ static void mxs_mmc_adtc(struct mxs_mmc_host *host)
goto out; goto out;
dmaengine_submit(desc); dmaengine_submit(desc);
dma_async_issue_pending(host->dmach);
return; return;
out: out:
dev_warn(mmc_dev(host->mmc), dev_warn(mmc_dev(host->mmc),
......
...@@ -266,6 +266,7 @@ int start_dma_without_bch_irq(struct gpmi_nand_data *this, ...@@ -266,6 +266,7 @@ int start_dma_without_bch_irq(struct gpmi_nand_data *this,
desc->callback = dma_irq_callback; desc->callback = dma_irq_callback;
desc->callback_param = this; desc->callback_param = this;
dmaengine_submit(desc); dmaengine_submit(desc);
dma_async_issue_pending(get_dma_chan(this));
/* Wait for the interrupt from the DMA block. */ /* Wait for the interrupt from the DMA block. */
err = wait_for_completion_timeout(dma_c, msecs_to_jiffies(1000)); err = wait_for_completion_timeout(dma_c, msecs_to_jiffies(1000));
......
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