aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/dma')
-rw-r--r--drivers/dma/at_hdmac.c21
-rw-r--r--drivers/dma/ep93xx_dma.c2
-rw-r--r--drivers/dma/fsldma.c2
-rw-r--r--drivers/dma/imx-dma.c4
-rw-r--r--drivers/dma/intel_mid_dma.c2
-rw-r--r--drivers/dma/intel_mid_dma_regs.h6
-rw-r--r--drivers/dma/ioat/hw.h4
-rw-r--r--drivers/dma/pl330.c23
-rw-r--r--drivers/dma/ppc4xx/adma.c2
-rw-r--r--drivers/dma/ste_dma40_ll.h2
10 files changed, 41 insertions, 27 deletions
diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c
index 3934fcc4e00b..17d6958342e7 100644
--- a/drivers/dma/at_hdmac.c
+++ b/drivers/dma/at_hdmac.c
@@ -168,9 +168,9 @@ static void atc_desc_put(struct at_dma_chan *atchan, struct at_desc *desc)
168} 168}
169 169
170/** 170/**
171 * atc_desc_chain - build chain adding a descripor 171 * atc_desc_chain - build chain adding a descriptor
172 * @first: address of first descripor of the chain 172 * @first: address of first descriptor of the chain
173 * @prev: address of previous descripor of the chain 173 * @prev: address of previous descriptor of the chain
174 * @desc: descriptor to queue 174 * @desc: descriptor to queue
175 * 175 *
176 * Called from prep_* functions 176 * Called from prep_* functions
@@ -661,7 +661,7 @@ atc_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
661 flags); 661 flags);
662 662
663 if (unlikely(!atslave || !sg_len)) { 663 if (unlikely(!atslave || !sg_len)) {
664 dev_dbg(chan2dev(chan), "prep_dma_memcpy: length is zero!\n"); 664 dev_dbg(chan2dev(chan), "prep_slave_sg: sg length is zero!\n");
665 return NULL; 665 return NULL;
666 } 666 }
667 667
@@ -689,6 +689,11 @@ atc_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
689 689
690 mem = sg_dma_address(sg); 690 mem = sg_dma_address(sg);
691 len = sg_dma_len(sg); 691 len = sg_dma_len(sg);
692 if (unlikely(!len)) {
693 dev_dbg(chan2dev(chan),
694 "prep_slave_sg: sg(%d) data length is zero\n", i);
695 goto err;
696 }
692 mem_width = 2; 697 mem_width = 2;
693 if (unlikely(mem & 3 || len & 3)) 698 if (unlikely(mem & 3 || len & 3))
694 mem_width = 0; 699 mem_width = 0;
@@ -724,6 +729,11 @@ atc_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
724 729
725 mem = sg_dma_address(sg); 730 mem = sg_dma_address(sg);
726 len = sg_dma_len(sg); 731 len = sg_dma_len(sg);
732 if (unlikely(!len)) {
733 dev_dbg(chan2dev(chan),
734 "prep_slave_sg: sg(%d) data length is zero\n", i);
735 goto err;
736 }
727 mem_width = 2; 737 mem_width = 2;
728 if (unlikely(mem & 3 || len & 3)) 738 if (unlikely(mem & 3 || len & 3))
729 mem_width = 0; 739 mem_width = 0;
@@ -757,6 +767,7 @@ atc_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
757 767
758err_desc_get: 768err_desc_get:
759 dev_err(chan2dev(chan), "not enough descriptors available\n"); 769 dev_err(chan2dev(chan), "not enough descriptors available\n");
770err:
760 atc_desc_put(atchan, first); 771 atc_desc_put(atchan, first);
761 return NULL; 772 return NULL;
762} 773}
@@ -785,7 +796,7 @@ err_out:
785} 796}
786 797
787/** 798/**
788 * atc_dma_cyclic_fill_desc - Fill one period decriptor 799 * atc_dma_cyclic_fill_desc - Fill one period descriptor
789 */ 800 */
790static int 801static int
791atc_dma_cyclic_fill_desc(struct dma_chan *chan, struct at_desc *desc, 802atc_dma_cyclic_fill_desc(struct dma_chan *chan, struct at_desc *desc,
diff --git a/drivers/dma/ep93xx_dma.c b/drivers/dma/ep93xx_dma.c
index c64917ec313d..bb02fd981afb 100644
--- a/drivers/dma/ep93xx_dma.c
+++ b/drivers/dma/ep93xx_dma.c
@@ -1118,7 +1118,7 @@ fail:
1118 * @chan: channel 1118 * @chan: channel
1119 * @dma_addr: DMA mapped address of the buffer 1119 * @dma_addr: DMA mapped address of the buffer
1120 * @buf_len: length of the buffer (in bytes) 1120 * @buf_len: length of the buffer (in bytes)
1121 * @period_len: lenght of a single period 1121 * @period_len: length of a single period
1122 * @dir: direction of the operation 1122 * @dir: direction of the operation
1123 * @context: operation context (ignored) 1123 * @context: operation context (ignored)
1124 * 1124 *
diff --git a/drivers/dma/fsldma.c b/drivers/dma/fsldma.c
index 8f84761f98ba..094437b9d823 100644
--- a/drivers/dma/fsldma.c
+++ b/drivers/dma/fsldma.c
@@ -1015,7 +1015,7 @@ static irqreturn_t fsldma_chan_irq(int irq, void *data)
1015 /* 1015 /*
1016 * Programming Error 1016 * Programming Error
1017 * The DMA_INTERRUPT async_tx is a NULL transfer, which will 1017 * The DMA_INTERRUPT async_tx is a NULL transfer, which will
1018 * triger a PE interrupt. 1018 * trigger a PE interrupt.
1019 */ 1019 */
1020 if (stat & FSL_DMA_SR_PE) { 1020 if (stat & FSL_DMA_SR_PE) {
1021 chan_dbg(chan, "irq: Programming Error INT\n"); 1021 chan_dbg(chan, "irq: Programming Error INT\n");
diff --git a/drivers/dma/imx-dma.c b/drivers/dma/imx-dma.c
index 5084975d793c..54f580bb993c 100644
--- a/drivers/dma/imx-dma.c
+++ b/drivers/dma/imx-dma.c
@@ -572,8 +572,8 @@ static void imxdma_tasklet(unsigned long data)
572 if (desc->desc.callback) 572 if (desc->desc.callback)
573 desc->desc.callback(desc->desc.callback_param); 573 desc->desc.callback(desc->desc.callback_param);
574 574
575 /* If we are dealing with a cyclic descriptor keep it on ld_active 575 /* If we are dealing with a cyclic descriptor, keep it on ld_active
576 * and dont mark the descripor as complete. 576 * and dont mark the descriptor as complete.
577 * Only in non-cyclic cases it would be marked as complete 577 * Only in non-cyclic cases it would be marked as complete
578 */ 578 */
579 if (imxdma_chan_is_doing_cyclic(imxdmac)) 579 if (imxdma_chan_is_doing_cyclic(imxdmac))
diff --git a/drivers/dma/intel_mid_dma.c b/drivers/dma/intel_mid_dma.c
index 222e907bfaaa..02b21d7d38e5 100644
--- a/drivers/dma/intel_mid_dma.c
+++ b/drivers/dma/intel_mid_dma.c
@@ -427,7 +427,7 @@ DMA engine callback Functions*/
427 * intel_mid_dma_tx_submit - callback to submit DMA transaction 427 * intel_mid_dma_tx_submit - callback to submit DMA transaction
428 * @tx: dma engine descriptor 428 * @tx: dma engine descriptor
429 * 429 *
430 * Submit the DMA trasaction for this descriptor, start if ch idle 430 * Submit the DMA transaction for this descriptor, start if ch idle
431 */ 431 */
432static dma_cookie_t intel_mid_dma_tx_submit(struct dma_async_tx_descriptor *tx) 432static dma_cookie_t intel_mid_dma_tx_submit(struct dma_async_tx_descriptor *tx)
433{ 433{
diff --git a/drivers/dma/intel_mid_dma_regs.h b/drivers/dma/intel_mid_dma_regs.h
index 1bfa9268feaf..17b42192ea58 100644
--- a/drivers/dma/intel_mid_dma_regs.h
+++ b/drivers/dma/intel_mid_dma_regs.h
@@ -168,9 +168,9 @@ union intel_mid_dma_cfg_hi {
168 * @active_list: current active descriptors 168 * @active_list: current active descriptors
169 * @queue: current queued up descriptors 169 * @queue: current queued up descriptors
170 * @free_list: current free descriptors 170 * @free_list: current free descriptors
171 * @slave: dma slave struture 171 * @slave: dma slave structure
172 * @descs_allocated: total number of decsiptors allocated 172 * @descs_allocated: total number of descriptors allocated
173 * @dma: dma device struture pointer 173 * @dma: dma device structure pointer
174 * @busy: bool representing if ch is busy (active txn) or not 174 * @busy: bool representing if ch is busy (active txn) or not
175 * @in_use: bool representing if ch is in use or not 175 * @in_use: bool representing if ch is in use or not
176 * @raw_tfr: raw trf interrupt received 176 * @raw_tfr: raw trf interrupt received
diff --git a/drivers/dma/ioat/hw.h b/drivers/dma/ioat/hw.h
index 60e675455b6a..d2ff3fda0b18 100644
--- a/drivers/dma/ioat/hw.h
+++ b/drivers/dma/ioat/hw.h
@@ -22,7 +22,6 @@
22#define _IOAT_HW_H_ 22#define _IOAT_HW_H_
23 23
24/* PCI Configuration Space Values */ 24/* PCI Configuration Space Values */
25#define IOAT_PCI_VID 0x8086
26#define IOAT_MMIO_BAR 0 25#define IOAT_MMIO_BAR 0
27 26
28/* CB device ID's */ 27/* CB device ID's */
@@ -31,9 +30,6 @@
31#define IOAT_PCI_DID_SCNB 0x65FF 30#define IOAT_PCI_DID_SCNB 0x65FF
32#define IOAT_PCI_DID_SNB 0x402F 31#define IOAT_PCI_DID_SNB 0x402F
33 32
34#define IOAT_PCI_RID 0x00
35#define IOAT_PCI_SVID 0x8086
36#define IOAT_PCI_SID 0x8086
37#define IOAT_VER_1_2 0x12 /* Version 1.2 */ 33#define IOAT_VER_1_2 0x12 /* Version 1.2 */
38#define IOAT_VER_2_0 0x20 /* Version 2.0 */ 34#define IOAT_VER_2_0 0x20 /* Version 2.0 */
39#define IOAT_VER_3_0 0x30 /* Version 3.0 */ 35#define IOAT_VER_3_0 0x30 /* Version 3.0 */
diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
index e4feba6b03c0..5d3bbcd279b4 100644
--- a/drivers/dma/pl330.c
+++ b/drivers/dma/pl330.c
@@ -522,7 +522,7 @@ enum desc_status {
522 /* In the DMAC pool */ 522 /* In the DMAC pool */
523 FREE, 523 FREE,
524 /* 524 /*
525 * Allocted to some channel during prep_xxx 525 * Allocated to some channel during prep_xxx
526 * Also may be sitting on the work_list. 526 * Also may be sitting on the work_list.
527 */ 527 */
528 PREP, 528 PREP,
@@ -1567,17 +1567,19 @@ static int pl330_submit_req(void *ch_id, struct pl330_req *r)
1567 goto xfer_exit; 1567 goto xfer_exit;
1568 } 1568 }
1569 1569
1570 /* Prefer Secure Channel */
1571 if (!_manager_ns(thrd))
1572 r->cfg->nonsecure = 0;
1573 else
1574 r->cfg->nonsecure = 1;
1575 1570
1576 /* Use last settings, if not provided */ 1571 /* Use last settings, if not provided */
1577 if (r->cfg) 1572 if (r->cfg) {
1573 /* Prefer Secure Channel */
1574 if (!_manager_ns(thrd))
1575 r->cfg->nonsecure = 0;
1576 else
1577 r->cfg->nonsecure = 1;
1578
1578 ccr = _prepare_ccr(r->cfg); 1579 ccr = _prepare_ccr(r->cfg);
1579 else 1580 } else {
1580 ccr = readl(regs + CC(thrd->id)); 1581 ccr = readl(regs + CC(thrd->id));
1582 }
1581 1583
1582 /* If this req doesn't have valid xfer settings */ 1584 /* If this req doesn't have valid xfer settings */
1583 if (!_is_valid(ccr)) { 1585 if (!_is_valid(ccr)) {
@@ -2928,6 +2930,11 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id)
2928 num_chan = max_t(int, pi->pcfg.num_peri, pi->pcfg.num_chan); 2930 num_chan = max_t(int, pi->pcfg.num_peri, pi->pcfg.num_chan);
2929 2931
2930 pdmac->peripherals = kzalloc(num_chan * sizeof(*pch), GFP_KERNEL); 2932 pdmac->peripherals = kzalloc(num_chan * sizeof(*pch), GFP_KERNEL);
2933 if (!pdmac->peripherals) {
2934 ret = -ENOMEM;
2935 dev_err(&adev->dev, "unable to allocate pdmac->peripherals\n");
2936 goto probe_err5;
2937 }
2931 2938
2932 for (i = 0; i < num_chan; i++) { 2939 for (i = 0; i < num_chan; i++) {
2933 pch = &pdmac->peripherals[i]; 2940 pch = &pdmac->peripherals[i];
diff --git a/drivers/dma/ppc4xx/adma.c b/drivers/dma/ppc4xx/adma.c
index ced98826684a..f72348d0bc41 100644
--- a/drivers/dma/ppc4xx/adma.c
+++ b/drivers/dma/ppc4xx/adma.c
@@ -4446,7 +4446,7 @@ static int __devinit ppc440spe_adma_probe(struct platform_device *ofdev)
4446 ret = -ENOMEM; 4446 ret = -ENOMEM;
4447 goto err_dma_alloc; 4447 goto err_dma_alloc;
4448 } 4448 }
4449 dev_dbg(&ofdev->dev, "allocted descriptor pool virt 0x%p phys 0x%llx\n", 4449 dev_dbg(&ofdev->dev, "allocated descriptor pool virt 0x%p phys 0x%llx\n",
4450 adev->dma_desc_pool_virt, (u64)adev->dma_desc_pool); 4450 adev->dma_desc_pool_virt, (u64)adev->dma_desc_pool);
4451 4451
4452 regs = ioremap(res.start, resource_size(&res)); 4452 regs = ioremap(res.start, resource_size(&res));
diff --git a/drivers/dma/ste_dma40_ll.h b/drivers/dma/ste_dma40_ll.h
index 51e8e5396e9b..6d47373f3f58 100644
--- a/drivers/dma/ste_dma40_ll.h
+++ b/drivers/dma/ste_dma40_ll.h
@@ -202,7 +202,7 @@
202/* LLI related structures */ 202/* LLI related structures */
203 203
204/** 204/**
205 * struct d40_phy_lli - The basic configration register for each physical 205 * struct d40_phy_lli - The basic configuration register for each physical
206 * channel. 206 * channel.
207 * 207 *
208 * @reg_cfg: The configuration register. 208 * @reg_cfg: The configuration register.