Commit 5d43a1de authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/djbw/async_tx

* 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/djbw/async_tx:
  dmaengine: at_hdmac: fix buffer transfer size specification
  fsldma: fix issue of slow dma
  dmaengine i.MX SDMA: initialize on module_init
  dma : EG20T PCH: Fix miss-setting DMA descriptor
  intel_mid_dma: fix section mismatch warnings
  dmaengine: imx-sdma: fix bug in buffer descriptor initialization
  drivers/dma/ppc4xx: Use printf extension %pR for struct resource
  drivers/dma/ioat: Use the ccflag-y instead of EXTRA_CFLAGS
  drivers/dma/: Use the ccflag-y instead of EXTRA_CFLAGS
  dma: intel_mid_dma: fix double free on mid_setup_dma error path
  dma: imx-dma: fix imxdma_probe error path
parents 7103b71b 59a609d9
ifeq ($(CONFIG_DMADEVICES_DEBUG),y) ifeq ($(CONFIG_DMADEVICES_DEBUG),y)
EXTRA_CFLAGS += -DDEBUG ccflags-y += -DDEBUG
endif endif
ifeq ($(CONFIG_DMADEVICES_VDEBUG),y) ifeq ($(CONFIG_DMADEVICES_VDEBUG),y)
EXTRA_CFLAGS += -DVERBOSE_DEBUG ccflags-y += -DVERBOSE_DEBUG
endif endif
obj-$(CONFIG_DMA_ENGINE) += dmaengine.o obj-$(CONFIG_DMA_ENGINE) += dmaengine.o
......
...@@ -722,7 +722,7 @@ atc_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl, ...@@ -722,7 +722,7 @@ atc_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
desc->lli.daddr = mem; desc->lli.daddr = mem;
desc->lli.ctrla = ctrla desc->lli.ctrla = ctrla
| ATC_DST_WIDTH(mem_width) | ATC_DST_WIDTH(mem_width)
| len >> mem_width; | len >> reg_width;
desc->lli.ctrlb = ctrlb; desc->lli.ctrlb = ctrlb;
if (!first) { if (!first) {
......
...@@ -50,9 +50,11 @@ static void dma_init(struct fsldma_chan *chan) ...@@ -50,9 +50,11 @@ static void dma_init(struct fsldma_chan *chan)
* EIE - Error interrupt enable * EIE - Error interrupt enable
* EOSIE - End of segments interrupt enable (basic mode) * EOSIE - End of segments interrupt enable (basic mode)
* EOLNIE - End of links interrupt enable * EOLNIE - End of links interrupt enable
* BWC - Bandwidth sharing among channels
*/ */
DMA_OUT(chan, &chan->regs->mr, FSL_DMA_MR_EIE DMA_OUT(chan, &chan->regs->mr, FSL_DMA_MR_BWC
| FSL_DMA_MR_EOLNIE | FSL_DMA_MR_EOSIE, 32); | FSL_DMA_MR_EIE | FSL_DMA_MR_EOLNIE
| FSL_DMA_MR_EOSIE, 32);
break; break;
case FSL_DMA_IP_83XX: case FSL_DMA_IP_83XX:
/* Set the channel to below modes: /* Set the channel to below modes:
......
/* /*
* Copyright (C) 2007 Freescale Semiconductor, Inc. All rights reserved. * Copyright (C) 2007-2010 Freescale Semiconductor, Inc. All rights reserved.
* *
* Author: * Author:
* Zhang Wei <wei.zhang@freescale.com>, Jul 2007 * Zhang Wei <wei.zhang@freescale.com>, Jul 2007
...@@ -36,6 +36,13 @@ ...@@ -36,6 +36,13 @@
#define FSL_DMA_MR_DAHE 0x00002000 #define FSL_DMA_MR_DAHE 0x00002000
#define FSL_DMA_MR_SAHE 0x00001000 #define FSL_DMA_MR_SAHE 0x00001000
/*
* Bandwidth/pause control determines how many bytes a given
* channel is allowed to transfer before the DMA engine pauses
* the current channel and switches to the next channel
*/
#define FSL_DMA_MR_BWC 0x08000000
/* Special MR definition for MPC8349 */ /* Special MR definition for MPC8349 */
#define FSL_DMA_MR_EOTIE 0x00000080 #define FSL_DMA_MR_EOTIE 0x00000080
#define FSL_DMA_MR_PRC_RM 0x00000800 #define FSL_DMA_MR_PRC_RM 0x00000800
......
...@@ -379,7 +379,7 @@ static int __init imxdma_probe(struct platform_device *pdev) ...@@ -379,7 +379,7 @@ static int __init imxdma_probe(struct platform_device *pdev)
return 0; return 0;
err_init: err_init:
while (i-- >= 0) { while (--i >= 0) {
struct imxdma_channel *imxdmac = &imxdma->channel[i]; struct imxdma_channel *imxdmac = &imxdma->channel[i];
imx_dma_free(imxdmac->imxdma_channel); imx_dma_free(imxdmac->imxdma_channel);
} }
......
...@@ -951,7 +951,7 @@ static struct dma_async_tx_descriptor *sdma_prep_slave_sg( ...@@ -951,7 +951,7 @@ static struct dma_async_tx_descriptor *sdma_prep_slave_sg(
struct sdma_buffer_descriptor *bd = &sdmac->bd[i]; struct sdma_buffer_descriptor *bd = &sdmac->bd[i];
int param; int param;
bd->buffer_addr = sgl->dma_address; bd->buffer_addr = sg->dma_address;
count = sg->length; count = sg->length;
...@@ -1385,7 +1385,7 @@ static int __init sdma_module_init(void) ...@@ -1385,7 +1385,7 @@ static int __init sdma_module_init(void)
{ {
return platform_driver_probe(&sdma_driver, sdma_probe); return platform_driver_probe(&sdma_driver, sdma_probe);
} }
subsys_initcall(sdma_module_init); module_init(sdma_module_init);
MODULE_AUTHOR("Sascha Hauer, Pengutronix <s.hauer@pengutronix.de>"); MODULE_AUTHOR("Sascha Hauer, Pengutronix <s.hauer@pengutronix.de>");
MODULE_DESCRIPTION("i.MX SDMA driver"); MODULE_DESCRIPTION("i.MX SDMA driver");
......
...@@ -1075,7 +1075,6 @@ static int mid_setup_dma(struct pci_dev *pdev) ...@@ -1075,7 +1075,6 @@ static int mid_setup_dma(struct pci_dev *pdev)
if (NULL == dma->dma_pool) { if (NULL == dma->dma_pool) {
pr_err("ERR_MDMA:pci_pool_create failed\n"); pr_err("ERR_MDMA:pci_pool_create failed\n");
err = -ENOMEM; err = -ENOMEM;
kfree(dma);
goto err_dma_pool; goto err_dma_pool;
} }
...@@ -1186,7 +1185,6 @@ static int mid_setup_dma(struct pci_dev *pdev) ...@@ -1186,7 +1185,6 @@ static int mid_setup_dma(struct pci_dev *pdev)
free_irq(pdev->irq, dma); free_irq(pdev->irq, dma);
err_irq: err_irq:
pci_pool_destroy(dma->dma_pool); pci_pool_destroy(dma->dma_pool);
kfree(dma);
err_dma_pool: err_dma_pool:
pr_err("ERR_MDMA:setup_dma failed: %d\n", err); pr_err("ERR_MDMA:setup_dma failed: %d\n", err);
return err; return err;
...@@ -1413,7 +1411,7 @@ static const struct dev_pm_ops intel_mid_dma_pm = { ...@@ -1413,7 +1411,7 @@ static const struct dev_pm_ops intel_mid_dma_pm = {
.runtime_idle = dma_runtime_idle, .runtime_idle = dma_runtime_idle,
}; };
static struct pci_driver intel_mid_dma_pci = { static struct pci_driver intel_mid_dma_pci_driver = {
.name = "Intel MID DMA", .name = "Intel MID DMA",
.id_table = intel_mid_dma_ids, .id_table = intel_mid_dma_ids,
.probe = intel_mid_dma_probe, .probe = intel_mid_dma_probe,
...@@ -1431,13 +1429,13 @@ static int __init intel_mid_dma_init(void) ...@@ -1431,13 +1429,13 @@ static int __init intel_mid_dma_init(void)
{ {
pr_debug("INFO_MDMA: LNW DMA Driver Version %s\n", pr_debug("INFO_MDMA: LNW DMA Driver Version %s\n",
INTEL_MID_DMA_DRIVER_VERSION); INTEL_MID_DMA_DRIVER_VERSION);
return pci_register_driver(&intel_mid_dma_pci); return pci_register_driver(&intel_mid_dma_pci_driver);
} }
fs_initcall(intel_mid_dma_init); fs_initcall(intel_mid_dma_init);
static void __exit intel_mid_dma_exit(void) static void __exit intel_mid_dma_exit(void)
{ {
pci_unregister_driver(&intel_mid_dma_pci); pci_unregister_driver(&intel_mid_dma_pci_driver);
} }
module_exit(intel_mid_dma_exit); module_exit(intel_mid_dma_exit);
......
obj-$(CONFIG_INTEL_IOATDMA) += ioatdma.o obj-$(CONFIG_INTEL_IOATDMA) += ioatdma.o
ioatdma-objs := pci.o dma.o dma_v2.o dma_v3.o dca.o ioatdma-y := pci.o dma.o dma_v2.o dma_v3.o dca.o
...@@ -259,11 +259,6 @@ static void pdc_dostart(struct pch_dma_chan *pd_chan, struct pch_dma_desc* desc) ...@@ -259,11 +259,6 @@ static void pdc_dostart(struct pch_dma_chan *pd_chan, struct pch_dma_desc* desc)
return; return;
} }
channel_writel(pd_chan, DEV_ADDR, desc->regs.dev_addr);
channel_writel(pd_chan, MEM_ADDR, desc->regs.mem_addr);
channel_writel(pd_chan, SIZE, desc->regs.size);
channel_writel(pd_chan, NEXT, desc->regs.next);
dev_dbg(chan2dev(&pd_chan->chan), "chan %d -> dev_addr: %x\n", dev_dbg(chan2dev(&pd_chan->chan), "chan %d -> dev_addr: %x\n",
pd_chan->chan.chan_id, desc->regs.dev_addr); pd_chan->chan.chan_id, desc->regs.dev_addr);
dev_dbg(chan2dev(&pd_chan->chan), "chan %d -> mem_addr: %x\n", dev_dbg(chan2dev(&pd_chan->chan), "chan %d -> mem_addr: %x\n",
...@@ -273,10 +268,16 @@ static void pdc_dostart(struct pch_dma_chan *pd_chan, struct pch_dma_desc* desc) ...@@ -273,10 +268,16 @@ static void pdc_dostart(struct pch_dma_chan *pd_chan, struct pch_dma_desc* desc)
dev_dbg(chan2dev(&pd_chan->chan), "chan %d -> next: %x\n", dev_dbg(chan2dev(&pd_chan->chan), "chan %d -> next: %x\n",
pd_chan->chan.chan_id, desc->regs.next); pd_chan->chan.chan_id, desc->regs.next);
if (list_empty(&desc->tx_list)) if (list_empty(&desc->tx_list)) {
channel_writel(pd_chan, DEV_ADDR, desc->regs.dev_addr);
channel_writel(pd_chan, MEM_ADDR, desc->regs.mem_addr);
channel_writel(pd_chan, SIZE, desc->regs.size);
channel_writel(pd_chan, NEXT, desc->regs.next);
pdc_set_mode(&pd_chan->chan, DMA_CTL0_ONESHOT); pdc_set_mode(&pd_chan->chan, DMA_CTL0_ONESHOT);
else } else {
channel_writel(pd_chan, NEXT, desc->txd.phys);
pdc_set_mode(&pd_chan->chan, DMA_CTL0_SG); pdc_set_mode(&pd_chan->chan, DMA_CTL0_SG);
}
val = dma_readl(pd, CTL2); val = dma_readl(pd, CTL2);
val |= 1 << (DMA_CTL2_START_SHIFT_BITS + pd_chan->chan.chan_id); val |= 1 << (DMA_CTL2_START_SHIFT_BITS + pd_chan->chan.chan_id);
......
...@@ -4449,9 +4449,8 @@ static int __devinit ppc440spe_adma_probe(struct platform_device *ofdev, ...@@ -4449,9 +4449,8 @@ static int __devinit ppc440spe_adma_probe(struct platform_device *ofdev,
if (!request_mem_region(res.start, resource_size(&res), if (!request_mem_region(res.start, resource_size(&res),
dev_driver_string(&ofdev->dev))) { dev_driver_string(&ofdev->dev))) {
dev_err(&ofdev->dev, "failed to request memory region " dev_err(&ofdev->dev, "failed to request memory region %pR\n",
"(0x%016llx-0x%016llx)\n", &res);
(u64)res.start, (u64)res.end);
initcode = PPC_ADMA_INIT_MEMREG; initcode = PPC_ADMA_INIT_MEMREG;
ret = -EBUSY; ret = -EBUSY;
goto out; goto out;
......
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