aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2011-01-31 06:42:51 -0500
committerSascha Hauer <s.hauer@pengutronix.de>2011-01-31 06:42:51 -0500
commit60f1df5dc6ecd07befc332ae30109fb86505634c (patch)
tree77cb78a15424ff493f4d171d66752009b4483420 /drivers/dma
parent2335d338a20a6f5ac70ae4338733c8ff5933f978 (diff)
parent341b9419a8c0a4cdb75773c576870f1eb655516d (diff)
Merge branch 'dmaengine-shawn' into dmaengine
Diffstat (limited to 'drivers/dma')
-rw-r--r--drivers/dma/imx-sdma.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c
index 1eb3f0077403..0123740b973d 100644
--- a/drivers/dma/imx-sdma.c
+++ b/drivers/dma/imx-sdma.c
@@ -450,7 +450,7 @@ static void sdma_handle_channel_loop(struct sdma_channel *sdmac)
450 if (bd->mode.status & BD_RROR) 450 if (bd->mode.status & BD_RROR)
451 sdmac->status = DMA_ERROR; 451 sdmac->status = DMA_ERROR;
452 else 452 else
453 sdmac->status = DMA_SUCCESS; 453 sdmac->status = DMA_IN_PROGRESS;
454 454
455 bd->mode.status |= BD_DONE; 455 bd->mode.status |= BD_DONE;
456 sdmac->buf_tail++; 456 sdmac->buf_tail++;
@@ -942,15 +942,12 @@ static struct dma_async_tx_descriptor *sdma_prep_slave_sg(
942 942
943 param = BD_DONE | BD_EXTD | BD_CONT; 943 param = BD_DONE | BD_EXTD | BD_CONT;
944 944
945 if (sdmac->flags & IMX_DMA_SG_LOOP) { 945 if (i + 1 == sg_len) {
946 param |= BD_INTR; 946 param |= BD_INTR;
947 if (i + 1 == sg_len) 947 param |= BD_LAST;
948 param |= BD_WRAP; 948 param &= ~BD_CONT;
949 } 949 }
950 950
951 if (i + 1 == sg_len)
952 param |= BD_INTR;
953
954 dev_dbg(sdma->dev, "entry %d: count: %d dma: 0x%08x %s%s\n", 951 dev_dbg(sdma->dev, "entry %d: count: %d dma: 0x%08x %s%s\n",
955 i, count, sg->dma_address, 952 i, count, sg->dma_address,
956 param & BD_WRAP ? "wrap" : "", 953 param & BD_WRAP ? "wrap" : "",
@@ -964,6 +961,7 @@ static struct dma_async_tx_descriptor *sdma_prep_slave_sg(
964 961
965 return &sdmac->desc; 962 return &sdmac->desc;
966err_out: 963err_out:
964 sdmac->status = DMA_ERROR;
967 return NULL; 965 return NULL;
968} 966}
969 967
@@ -1077,14 +1075,12 @@ static enum dma_status sdma_tx_status(struct dma_chan *chan,
1077{ 1075{
1078 struct sdma_channel *sdmac = to_sdma_chan(chan); 1076 struct sdma_channel *sdmac = to_sdma_chan(chan);
1079 dma_cookie_t last_used; 1077 dma_cookie_t last_used;
1080 enum dma_status ret;
1081 1078
1082 last_used = chan->cookie; 1079 last_used = chan->cookie;
1083 1080
1084 ret = dma_async_is_complete(cookie, sdmac->last_completed, last_used);
1085 dma_set_tx_state(txstate, sdmac->last_completed, last_used, 0); 1081 dma_set_tx_state(txstate, sdmac->last_completed, last_used, 0);
1086 1082
1087 return ret; 1083 return sdmac->status;
1088} 1084}
1089 1085
1090static void sdma_issue_pending(struct dma_chan *chan) 1086static void sdma_issue_pending(struct dma_chan *chan)