aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/dma/dw_dmac.c5
-rw-r--r--drivers/dma/intel_mid_dma.c17
-rw-r--r--drivers/dma/iop-adma.c6
-rw-r--r--drivers/dma/mv_xor.c6
-rw-r--r--drivers/dma/ppc4xx/adma.c8
5 files changed, 28 insertions, 14 deletions
diff --git a/drivers/dma/dw_dmac.c b/drivers/dma/dw_dmac.c
index 9c25c7d099e4..b15c32ca0efa 100644
--- a/drivers/dma/dw_dmac.c
+++ b/drivers/dma/dw_dmac.c
@@ -304,6 +304,11 @@ static void dwc_scan_descriptors(struct dw_dma *dw, struct dw_dma_chan *dwc)
304 dev_vdbg(chan2dev(&dwc->chan), "scan_descriptors: llp=0x%x\n", llp); 304 dev_vdbg(chan2dev(&dwc->chan), "scan_descriptors: llp=0x%x\n", llp);
305 305
306 list_for_each_entry_safe(desc, _desc, &dwc->active_list, desc_node) { 306 list_for_each_entry_safe(desc, _desc, &dwc->active_list, desc_node) {
307 /* check first descriptors addr */
308 if (desc->txd.phys == llp)
309 return;
310
311 /* check first descriptors llp */
307 if (desc->lli.llp == llp) 312 if (desc->lli.llp == llp)
308 /* This one is currently in progress */ 313 /* This one is currently in progress */
309 return; 314 return;
diff --git a/drivers/dma/intel_mid_dma.c b/drivers/dma/intel_mid_dma.c
index 798f46a4590d..f153adfcaceb 100644
--- a/drivers/dma/intel_mid_dma.c
+++ b/drivers/dma/intel_mid_dma.c
@@ -1292,8 +1292,7 @@ static int __devinit intel_mid_dma_probe(struct pci_dev *pdev,
1292 if (err) 1292 if (err)
1293 goto err_dma; 1293 goto err_dma;
1294 1294
1295 pm_runtime_set_active(&pdev->dev); 1295 pm_runtime_put_noidle(&pdev->dev);
1296 pm_runtime_enable(&pdev->dev);
1297 pm_runtime_allow(&pdev->dev); 1296 pm_runtime_allow(&pdev->dev);
1298 return 0; 1297 return 0;
1299 1298
@@ -1322,6 +1321,9 @@ err_enable_device:
1322static void __devexit intel_mid_dma_remove(struct pci_dev *pdev) 1321static void __devexit intel_mid_dma_remove(struct pci_dev *pdev)
1323{ 1322{
1324 struct middma_device *device = pci_get_drvdata(pdev); 1323 struct middma_device *device = pci_get_drvdata(pdev);
1324
1325 pm_runtime_get_noresume(&pdev->dev);
1326 pm_runtime_forbid(&pdev->dev);
1325 middma_shutdown(pdev); 1327 middma_shutdown(pdev);
1326 pci_dev_put(pdev); 1328 pci_dev_put(pdev);
1327 kfree(device); 1329 kfree(device);
@@ -1385,13 +1387,20 @@ int dma_resume(struct pci_dev *pci)
1385static int dma_runtime_suspend(struct device *dev) 1387static int dma_runtime_suspend(struct device *dev)
1386{ 1388{
1387 struct pci_dev *pci_dev = to_pci_dev(dev); 1389 struct pci_dev *pci_dev = to_pci_dev(dev);
1388 return dma_suspend(pci_dev, PMSG_SUSPEND); 1390 struct middma_device *device = pci_get_drvdata(pci_dev);
1391
1392 device->state = SUSPENDED;
1393 return 0;
1389} 1394}
1390 1395
1391static int dma_runtime_resume(struct device *dev) 1396static int dma_runtime_resume(struct device *dev)
1392{ 1397{
1393 struct pci_dev *pci_dev = to_pci_dev(dev); 1398 struct pci_dev *pci_dev = to_pci_dev(dev);
1394 return dma_resume(pci_dev); 1399 struct middma_device *device = pci_get_drvdata(pci_dev);
1400
1401 device->state = RUNNING;
1402 iowrite32(REG_BIT0, device->dma_base + DMA_CFG);
1403 return 0;
1395} 1404}
1396 1405
1397static int dma_runtime_idle(struct device *dev) 1406static int dma_runtime_idle(struct device *dev)
diff --git a/drivers/dma/iop-adma.c b/drivers/dma/iop-adma.c
index c6b01f535b29..e03f811a83dd 100644
--- a/drivers/dma/iop-adma.c
+++ b/drivers/dma/iop-adma.c
@@ -619,7 +619,7 @@ iop_adma_prep_dma_memcpy(struct dma_chan *chan, dma_addr_t dma_dest,
619 619
620 if (unlikely(!len)) 620 if (unlikely(!len))
621 return NULL; 621 return NULL;
622 BUG_ON(unlikely(len > IOP_ADMA_MAX_BYTE_COUNT)); 622 BUG_ON(len > IOP_ADMA_MAX_BYTE_COUNT);
623 623
624 dev_dbg(iop_chan->device->common.dev, "%s len: %u\n", 624 dev_dbg(iop_chan->device->common.dev, "%s len: %u\n",
625 __func__, len); 625 __func__, len);
@@ -652,7 +652,7 @@ iop_adma_prep_dma_memset(struct dma_chan *chan, dma_addr_t dma_dest,
652 652
653 if (unlikely(!len)) 653 if (unlikely(!len))
654 return NULL; 654 return NULL;
655 BUG_ON(unlikely(len > IOP_ADMA_MAX_BYTE_COUNT)); 655 BUG_ON(len > IOP_ADMA_MAX_BYTE_COUNT);
656 656
657 dev_dbg(iop_chan->device->common.dev, "%s len: %u\n", 657 dev_dbg(iop_chan->device->common.dev, "%s len: %u\n",
658 __func__, len); 658 __func__, len);
@@ -686,7 +686,7 @@ iop_adma_prep_dma_xor(struct dma_chan *chan, dma_addr_t dma_dest,
686 686
687 if (unlikely(!len)) 687 if (unlikely(!len))
688 return NULL; 688 return NULL;
689 BUG_ON(unlikely(len > IOP_ADMA_XOR_MAX_BYTE_COUNT)); 689 BUG_ON(len > IOP_ADMA_XOR_MAX_BYTE_COUNT);
690 690
691 dev_dbg(iop_chan->device->common.dev, 691 dev_dbg(iop_chan->device->common.dev,
692 "%s src_cnt: %d len: %u flags: %lx\n", 692 "%s src_cnt: %d len: %u flags: %lx\n",
diff --git a/drivers/dma/mv_xor.c b/drivers/dma/mv_xor.c
index a25f5f61e0e0..954e334e01bb 100644
--- a/drivers/dma/mv_xor.c
+++ b/drivers/dma/mv_xor.c
@@ -671,7 +671,7 @@ mv_xor_prep_dma_memcpy(struct dma_chan *chan, dma_addr_t dest, dma_addr_t src,
671 if (unlikely(len < MV_XOR_MIN_BYTE_COUNT)) 671 if (unlikely(len < MV_XOR_MIN_BYTE_COUNT))
672 return NULL; 672 return NULL;
673 673
674 BUG_ON(unlikely(len > MV_XOR_MAX_BYTE_COUNT)); 674 BUG_ON(len > MV_XOR_MAX_BYTE_COUNT);
675 675
676 spin_lock_bh(&mv_chan->lock); 676 spin_lock_bh(&mv_chan->lock);
677 slot_cnt = mv_chan_memcpy_slot_count(len); 677 slot_cnt = mv_chan_memcpy_slot_count(len);
@@ -710,7 +710,7 @@ mv_xor_prep_dma_memset(struct dma_chan *chan, dma_addr_t dest, int value,
710 if (unlikely(len < MV_XOR_MIN_BYTE_COUNT)) 710 if (unlikely(len < MV_XOR_MIN_BYTE_COUNT))
711 return NULL; 711 return NULL;
712 712
713 BUG_ON(unlikely(len > MV_XOR_MAX_BYTE_COUNT)); 713 BUG_ON(len > MV_XOR_MAX_BYTE_COUNT);
714 714
715 spin_lock_bh(&mv_chan->lock); 715 spin_lock_bh(&mv_chan->lock);
716 slot_cnt = mv_chan_memset_slot_count(len); 716 slot_cnt = mv_chan_memset_slot_count(len);
@@ -744,7 +744,7 @@ mv_xor_prep_dma_xor(struct dma_chan *chan, dma_addr_t dest, dma_addr_t *src,
744 if (unlikely(len < MV_XOR_MIN_BYTE_COUNT)) 744 if (unlikely(len < MV_XOR_MIN_BYTE_COUNT))
745 return NULL; 745 return NULL;
746 746
747 BUG_ON(unlikely(len > MV_XOR_MAX_BYTE_COUNT)); 747 BUG_ON(len > MV_XOR_MAX_BYTE_COUNT);
748 748
749 dev_dbg(mv_chan->device->common.dev, 749 dev_dbg(mv_chan->device->common.dev,
750 "%s src_cnt: %d len: dest %x %u flags: %ld\n", 750 "%s src_cnt: %d len: dest %x %u flags: %ld\n",
diff --git a/drivers/dma/ppc4xx/adma.c b/drivers/dma/ppc4xx/adma.c
index 3b0247e74cc4..fc457a7e8832 100644
--- a/drivers/dma/ppc4xx/adma.c
+++ b/drivers/dma/ppc4xx/adma.c
@@ -2313,7 +2313,7 @@ static struct dma_async_tx_descriptor *ppc440spe_adma_prep_dma_memcpy(
2313 if (unlikely(!len)) 2313 if (unlikely(!len))
2314 return NULL; 2314 return NULL;
2315 2315
2316 BUG_ON(unlikely(len > PPC440SPE_ADMA_DMA_MAX_BYTE_COUNT)); 2316 BUG_ON(len > PPC440SPE_ADMA_DMA_MAX_BYTE_COUNT);
2317 2317
2318 spin_lock_bh(&ppc440spe_chan->lock); 2318 spin_lock_bh(&ppc440spe_chan->lock);
2319 2319
@@ -2354,7 +2354,7 @@ static struct dma_async_tx_descriptor *ppc440spe_adma_prep_dma_memset(
2354 if (unlikely(!len)) 2354 if (unlikely(!len))
2355 return NULL; 2355 return NULL;
2356 2356
2357 BUG_ON(unlikely(len > PPC440SPE_ADMA_DMA_MAX_BYTE_COUNT)); 2357 BUG_ON(len > PPC440SPE_ADMA_DMA_MAX_BYTE_COUNT);
2358 2358
2359 spin_lock_bh(&ppc440spe_chan->lock); 2359 spin_lock_bh(&ppc440spe_chan->lock);
2360 2360
@@ -2397,7 +2397,7 @@ static struct dma_async_tx_descriptor *ppc440spe_adma_prep_dma_xor(
2397 dma_dest, dma_src, src_cnt)); 2397 dma_dest, dma_src, src_cnt));
2398 if (unlikely(!len)) 2398 if (unlikely(!len))
2399 return NULL; 2399 return NULL;
2400 BUG_ON(unlikely(len > PPC440SPE_ADMA_XOR_MAX_BYTE_COUNT)); 2400 BUG_ON(len > PPC440SPE_ADMA_XOR_MAX_BYTE_COUNT);
2401 2401
2402 dev_dbg(ppc440spe_chan->device->common.dev, 2402 dev_dbg(ppc440spe_chan->device->common.dev,
2403 "ppc440spe adma%d: %s src_cnt: %d len: %u int_en: %d\n", 2403 "ppc440spe adma%d: %s src_cnt: %d len: %u int_en: %d\n",
@@ -2887,7 +2887,7 @@ static struct dma_async_tx_descriptor *ppc440spe_adma_prep_dma_pq(
2887 ADMA_LL_DBG(prep_dma_pq_dbg(ppc440spe_chan->device->id, 2887 ADMA_LL_DBG(prep_dma_pq_dbg(ppc440spe_chan->device->id,
2888 dst, src, src_cnt)); 2888 dst, src, src_cnt));
2889 BUG_ON(!len); 2889 BUG_ON(!len);
2890 BUG_ON(unlikely(len > PPC440SPE_ADMA_XOR_MAX_BYTE_COUNT)); 2890 BUG_ON(len > PPC440SPE_ADMA_XOR_MAX_BYTE_COUNT);
2891 BUG_ON(!src_cnt); 2891 BUG_ON(!src_cnt);
2892 2892
2893 if (src_cnt == 1 && dst[1] == src[0]) { 2893 if (src_cnt == 1 && dst[1] == src[0]) {