diff options
Diffstat (limited to 'drivers/dma/mv_xor.c')
-rw-r--r-- | drivers/dma/mv_xor.c | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/drivers/dma/mv_xor.c b/drivers/dma/mv_xor.c index 466ab10c1ff1..79fb1dea691b 100644 --- a/drivers/dma/mv_xor.c +++ b/drivers/dma/mv_xor.c | |||
@@ -809,14 +809,14 @@ static void mv_xor_free_chan_resources(struct dma_chan *chan) | |||
809 | } | 809 | } |
810 | 810 | ||
811 | /** | 811 | /** |
812 | * mv_xor_is_complete - poll the status of an XOR transaction | 812 | * mv_xor_status - poll the status of an XOR transaction |
813 | * @chan: XOR channel handle | 813 | * @chan: XOR channel handle |
814 | * @cookie: XOR transaction identifier | 814 | * @cookie: XOR transaction identifier |
815 | * @txstate: XOR transactions state holder (or NULL) | ||
815 | */ | 816 | */ |
816 | static enum dma_status mv_xor_is_complete(struct dma_chan *chan, | 817 | static enum dma_status mv_xor_status(struct dma_chan *chan, |
817 | dma_cookie_t cookie, | 818 | dma_cookie_t cookie, |
818 | dma_cookie_t *done, | 819 | struct dma_tx_state *txstate) |
819 | dma_cookie_t *used) | ||
820 | { | 820 | { |
821 | struct mv_xor_chan *mv_chan = to_mv_xor_chan(chan); | 821 | struct mv_xor_chan *mv_chan = to_mv_xor_chan(chan); |
822 | dma_cookie_t last_used; | 822 | dma_cookie_t last_used; |
@@ -826,10 +826,11 @@ static enum dma_status mv_xor_is_complete(struct dma_chan *chan, | |||
826 | last_used = chan->cookie; | 826 | last_used = chan->cookie; |
827 | last_complete = mv_chan->completed_cookie; | 827 | last_complete = mv_chan->completed_cookie; |
828 | mv_chan->is_complete_cookie = cookie; | 828 | mv_chan->is_complete_cookie = cookie; |
829 | if (done) | 829 | if (txstate) { |
830 | *done = last_complete; | 830 | txstate->last = last_complete; |
831 | if (used) | 831 | txstate->used = last_used; |
832 | *used = last_used; | 832 | txstate->residue = 0; |
833 | } | ||
833 | 834 | ||
834 | ret = dma_async_is_complete(cookie, last_complete, last_used); | 835 | ret = dma_async_is_complete(cookie, last_complete, last_used); |
835 | if (ret == DMA_SUCCESS) { | 836 | if (ret == DMA_SUCCESS) { |
@@ -841,10 +842,11 @@ static enum dma_status mv_xor_is_complete(struct dma_chan *chan, | |||
841 | last_used = chan->cookie; | 842 | last_used = chan->cookie; |
842 | last_complete = mv_chan->completed_cookie; | 843 | last_complete = mv_chan->completed_cookie; |
843 | 844 | ||
844 | if (done) | 845 | if (txstate) { |
845 | *done = last_complete; | 846 | txstate->last = last_complete; |
846 | if (used) | 847 | txstate->used = last_used; |
847 | *used = last_used; | 848 | txstate->residue = 0; |
849 | } | ||
848 | 850 | ||
849 | return dma_async_is_complete(cookie, last_complete, last_used); | 851 | return dma_async_is_complete(cookie, last_complete, last_used); |
850 | } | 852 | } |
@@ -974,7 +976,7 @@ static int __devinit mv_xor_memcpy_self_test(struct mv_xor_device *device) | |||
974 | async_tx_ack(tx); | 976 | async_tx_ack(tx); |
975 | msleep(1); | 977 | msleep(1); |
976 | 978 | ||
977 | if (mv_xor_is_complete(dma_chan, cookie, NULL, NULL) != | 979 | if (mv_xor_status(dma_chan, cookie, NULL) != |
978 | DMA_SUCCESS) { | 980 | DMA_SUCCESS) { |
979 | dev_printk(KERN_ERR, dma_chan->device->dev, | 981 | dev_printk(KERN_ERR, dma_chan->device->dev, |
980 | "Self-test copy timed out, disabling\n"); | 982 | "Self-test copy timed out, disabling\n"); |
@@ -1072,7 +1074,7 @@ mv_xor_xor_self_test(struct mv_xor_device *device) | |||
1072 | async_tx_ack(tx); | 1074 | async_tx_ack(tx); |
1073 | msleep(8); | 1075 | msleep(8); |
1074 | 1076 | ||
1075 | if (mv_xor_is_complete(dma_chan, cookie, NULL, NULL) != | 1077 | if (mv_xor_status(dma_chan, cookie, NULL) != |
1076 | DMA_SUCCESS) { | 1078 | DMA_SUCCESS) { |
1077 | dev_printk(KERN_ERR, dma_chan->device->dev, | 1079 | dev_printk(KERN_ERR, dma_chan->device->dev, |
1078 | "Self-test xor timed out, disabling\n"); | 1080 | "Self-test xor timed out, disabling\n"); |
@@ -1167,7 +1169,7 @@ static int __devinit mv_xor_probe(struct platform_device *pdev) | |||
1167 | /* set base routines */ | 1169 | /* set base routines */ |
1168 | dma_dev->device_alloc_chan_resources = mv_xor_alloc_chan_resources; | 1170 | dma_dev->device_alloc_chan_resources = mv_xor_alloc_chan_resources; |
1169 | dma_dev->device_free_chan_resources = mv_xor_free_chan_resources; | 1171 | dma_dev->device_free_chan_resources = mv_xor_free_chan_resources; |
1170 | dma_dev->device_is_tx_complete = mv_xor_is_complete; | 1172 | dma_dev->device_tx_status = mv_xor_status; |
1171 | dma_dev->device_issue_pending = mv_xor_issue_pending; | 1173 | dma_dev->device_issue_pending = mv_xor_issue_pending; |
1172 | dma_dev->dev = &pdev->dev; | 1174 | dma_dev->dev = &pdev->dev; |
1173 | 1175 | ||