aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma
diff options
context:
space:
mode:
authorVinod Koul <vinod.koul@intel.com>2016-05-17 00:45:06 -0400
committerVinod Koul <vinod.koul@intel.com>2016-05-17 00:45:06 -0400
commitba8b6cc07267fbf792cb7521cabc13879b227f4f (patch)
treea3d62b213e39373a3e0b3552be27a2fde1c5501d /drivers/dma
parent4dc50060c9fe68db800b14b2996de7ab88240986 (diff)
parent4e0def887d717598ae8062b46e55f9e00d3a5783 (diff)
Merge branch 'topic/pxa' into for-linus
Diffstat (limited to 'drivers/dma')
-rw-r--r--drivers/dma/pxa_dma.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/drivers/dma/pxa_dma.c b/drivers/dma/pxa_dma.c
index 77c1c44009d8..e756a30ccba2 100644
--- a/drivers/dma/pxa_dma.c
+++ b/drivers/dma/pxa_dma.c
@@ -117,6 +117,7 @@ struct pxad_chan {
117 /* protected by vc->lock */ 117 /* protected by vc->lock */
118 struct pxad_phy *phy; 118 struct pxad_phy *phy;
119 struct dma_pool *desc_pool; /* Descriptors pool */ 119 struct dma_pool *desc_pool; /* Descriptors pool */
120 dma_cookie_t bus_error;
120}; 121};
121 122
122struct pxad_device { 123struct pxad_device {
@@ -563,6 +564,7 @@ static void pxad_launch_chan(struct pxad_chan *chan,
563 return; 564 return;
564 } 565 }
565 } 566 }
567 chan->bus_error = 0;
566 568
567 /* 569 /*
568 * Program the descriptor's address into the DMA controller, 570 * Program the descriptor's address into the DMA controller,
@@ -666,6 +668,7 @@ static irqreturn_t pxad_chan_handler(int irq, void *dev_id)
666 struct virt_dma_desc *vd, *tmp; 668 struct virt_dma_desc *vd, *tmp;
667 unsigned int dcsr; 669 unsigned int dcsr;
668 unsigned long flags; 670 unsigned long flags;
671 dma_cookie_t last_started = 0;
669 672
670 BUG_ON(!chan); 673 BUG_ON(!chan);
671 674
@@ -678,6 +681,7 @@ static irqreturn_t pxad_chan_handler(int irq, void *dev_id)
678 dev_dbg(&chan->vc.chan.dev->device, 681 dev_dbg(&chan->vc.chan.dev->device,
679 "%s(): checking txd %p[%x]: completed=%d\n", 682 "%s(): checking txd %p[%x]: completed=%d\n",
680 __func__, vd, vd->tx.cookie, is_desc_completed(vd)); 683 __func__, vd, vd->tx.cookie, is_desc_completed(vd));
684 last_started = vd->tx.cookie;
681 if (to_pxad_sw_desc(vd)->cyclic) { 685 if (to_pxad_sw_desc(vd)->cyclic) {
682 vchan_cyclic_callback(vd); 686 vchan_cyclic_callback(vd);
683 break; 687 break;
@@ -690,7 +694,12 @@ static irqreturn_t pxad_chan_handler(int irq, void *dev_id)
690 } 694 }
691 } 695 }
692 696
693 if (dcsr & PXA_DCSR_STOPSTATE) { 697 if (dcsr & PXA_DCSR_BUSERR) {
698 chan->bus_error = last_started;
699 phy_disable(phy);
700 }
701
702 if (!chan->bus_error && dcsr & PXA_DCSR_STOPSTATE) {
694 dev_dbg(&chan->vc.chan.dev->device, 703 dev_dbg(&chan->vc.chan.dev->device,
695 "%s(): channel stopped, submitted_empty=%d issued_empty=%d", 704 "%s(): channel stopped, submitted_empty=%d issued_empty=%d",
696 __func__, 705 __func__,
@@ -1249,6 +1258,9 @@ static enum dma_status pxad_tx_status(struct dma_chan *dchan,
1249 struct pxad_chan *chan = to_pxad_chan(dchan); 1258 struct pxad_chan *chan = to_pxad_chan(dchan);
1250 enum dma_status ret; 1259 enum dma_status ret;
1251 1260
1261 if (cookie == chan->bus_error)
1262 return DMA_ERROR;
1263
1252 ret = dma_cookie_status(dchan, cookie, txstate); 1264 ret = dma_cookie_status(dchan, cookie, txstate);
1253 if (likely(txstate && (ret != DMA_ERROR))) 1265 if (likely(txstate && (ret != DMA_ERROR)))
1254 dma_set_residue(txstate, pxad_residue(chan, cookie)); 1266 dma_set_residue(txstate, pxad_residue(chan, cookie));
@@ -1321,7 +1333,7 @@ static int pxad_init_phys(struct platform_device *op,
1321 return 0; 1333 return 0;
1322} 1334}
1323 1335
1324static const struct of_device_id const pxad_dt_ids[] = { 1336static const struct of_device_id pxad_dt_ids[] = {
1325 { .compatible = "marvell,pdma-1.0", }, 1337 { .compatible = "marvell,pdma-1.0", },
1326 {} 1338 {}
1327}; 1339};