diff options
Diffstat (limited to 'drivers/dma/iop-adma.c')
-rw-r--r-- | drivers/dma/iop-adma.c | 39 |
1 files changed, 15 insertions, 24 deletions
diff --git a/drivers/dma/iop-adma.c b/drivers/dma/iop-adma.c index 1ebc801678b0..161c452923b8 100644 --- a/drivers/dma/iop-adma.c +++ b/drivers/dma/iop-adma.c | |||
@@ -894,14 +894,14 @@ static void iop_adma_free_chan_resources(struct dma_chan *chan) | |||
894 | } | 894 | } |
895 | 895 | ||
896 | /** | 896 | /** |
897 | * iop_adma_is_complete - poll the status of an ADMA transaction | 897 | * iop_adma_status - poll the status of an ADMA transaction |
898 | * @chan: ADMA channel handle | 898 | * @chan: ADMA channel handle |
899 | * @cookie: ADMA transaction identifier | 899 | * @cookie: ADMA transaction identifier |
900 | * @txstate: a holder for the current state of the channel or NULL | ||
900 | */ | 901 | */ |
901 | static enum dma_status iop_adma_is_complete(struct dma_chan *chan, | 902 | static enum dma_status iop_adma_status(struct dma_chan *chan, |
902 | dma_cookie_t cookie, | 903 | dma_cookie_t cookie, |
903 | dma_cookie_t *done, | 904 | struct dma_tx_state *txstate) |
904 | dma_cookie_t *used) | ||
905 | { | 905 | { |
906 | struct iop_adma_chan *iop_chan = to_iop_adma_chan(chan); | 906 | struct iop_adma_chan *iop_chan = to_iop_adma_chan(chan); |
907 | dma_cookie_t last_used; | 907 | dma_cookie_t last_used; |
@@ -910,12 +910,7 @@ static enum dma_status iop_adma_is_complete(struct dma_chan *chan, | |||
910 | 910 | ||
911 | last_used = chan->cookie; | 911 | last_used = chan->cookie; |
912 | last_complete = iop_chan->completed_cookie; | 912 | last_complete = iop_chan->completed_cookie; |
913 | 913 | dma_set_tx_state(txstate, last_complete, last_used, 0); | |
914 | if (done) | ||
915 | *done = last_complete; | ||
916 | if (used) | ||
917 | *used = last_used; | ||
918 | |||
919 | ret = dma_async_is_complete(cookie, last_complete, last_used); | 914 | ret = dma_async_is_complete(cookie, last_complete, last_used); |
920 | if (ret == DMA_SUCCESS) | 915 | if (ret == DMA_SUCCESS) |
921 | return ret; | 916 | return ret; |
@@ -924,11 +919,7 @@ static enum dma_status iop_adma_is_complete(struct dma_chan *chan, | |||
924 | 919 | ||
925 | last_used = chan->cookie; | 920 | last_used = chan->cookie; |
926 | last_complete = iop_chan->completed_cookie; | 921 | last_complete = iop_chan->completed_cookie; |
927 | 922 | dma_set_tx_state(txstate, last_complete, last_used, 0); | |
928 | if (done) | ||
929 | *done = last_complete; | ||
930 | if (used) | ||
931 | *used = last_used; | ||
932 | 923 | ||
933 | return dma_async_is_complete(cookie, last_complete, last_used); | 924 | return dma_async_is_complete(cookie, last_complete, last_used); |
934 | } | 925 | } |
@@ -1043,7 +1034,7 @@ static int __devinit iop_adma_memcpy_self_test(struct iop_adma_device *device) | |||
1043 | iop_adma_issue_pending(dma_chan); | 1034 | iop_adma_issue_pending(dma_chan); |
1044 | msleep(1); | 1035 | msleep(1); |
1045 | 1036 | ||
1046 | if (iop_adma_is_complete(dma_chan, cookie, NULL, NULL) != | 1037 | if (iop_adma_status(dma_chan, cookie, NULL) != |
1047 | DMA_SUCCESS) { | 1038 | DMA_SUCCESS) { |
1048 | dev_printk(KERN_ERR, dma_chan->device->dev, | 1039 | dev_printk(KERN_ERR, dma_chan->device->dev, |
1049 | "Self-test copy timed out, disabling\n"); | 1040 | "Self-test copy timed out, disabling\n"); |
@@ -1143,7 +1134,7 @@ iop_adma_xor_val_self_test(struct iop_adma_device *device) | |||
1143 | iop_adma_issue_pending(dma_chan); | 1134 | iop_adma_issue_pending(dma_chan); |
1144 | msleep(8); | 1135 | msleep(8); |
1145 | 1136 | ||
1146 | if (iop_adma_is_complete(dma_chan, cookie, NULL, NULL) != | 1137 | if (iop_adma_status(dma_chan, cookie, NULL) != |
1147 | DMA_SUCCESS) { | 1138 | DMA_SUCCESS) { |
1148 | dev_printk(KERN_ERR, dma_chan->device->dev, | 1139 | dev_printk(KERN_ERR, dma_chan->device->dev, |
1149 | "Self-test xor timed out, disabling\n"); | 1140 | "Self-test xor timed out, disabling\n"); |
@@ -1190,7 +1181,7 @@ iop_adma_xor_val_self_test(struct iop_adma_device *device) | |||
1190 | iop_adma_issue_pending(dma_chan); | 1181 | iop_adma_issue_pending(dma_chan); |
1191 | msleep(8); | 1182 | msleep(8); |
1192 | 1183 | ||
1193 | if (iop_adma_is_complete(dma_chan, cookie, NULL, NULL) != DMA_SUCCESS) { | 1184 | if (iop_adma_status(dma_chan, cookie, NULL) != DMA_SUCCESS) { |
1194 | dev_printk(KERN_ERR, dma_chan->device->dev, | 1185 | dev_printk(KERN_ERR, dma_chan->device->dev, |
1195 | "Self-test zero sum timed out, disabling\n"); | 1186 | "Self-test zero sum timed out, disabling\n"); |
1196 | err = -ENODEV; | 1187 | err = -ENODEV; |
@@ -1214,7 +1205,7 @@ iop_adma_xor_val_self_test(struct iop_adma_device *device) | |||
1214 | iop_adma_issue_pending(dma_chan); | 1205 | iop_adma_issue_pending(dma_chan); |
1215 | msleep(8); | 1206 | msleep(8); |
1216 | 1207 | ||
1217 | if (iop_adma_is_complete(dma_chan, cookie, NULL, NULL) != DMA_SUCCESS) { | 1208 | if (iop_adma_status(dma_chan, cookie, NULL) != DMA_SUCCESS) { |
1218 | dev_printk(KERN_ERR, dma_chan->device->dev, | 1209 | dev_printk(KERN_ERR, dma_chan->device->dev, |
1219 | "Self-test memset timed out, disabling\n"); | 1210 | "Self-test memset timed out, disabling\n"); |
1220 | err = -ENODEV; | 1211 | err = -ENODEV; |
@@ -1246,7 +1237,7 @@ iop_adma_xor_val_self_test(struct iop_adma_device *device) | |||
1246 | iop_adma_issue_pending(dma_chan); | 1237 | iop_adma_issue_pending(dma_chan); |
1247 | msleep(8); | 1238 | msleep(8); |
1248 | 1239 | ||
1249 | if (iop_adma_is_complete(dma_chan, cookie, NULL, NULL) != DMA_SUCCESS) { | 1240 | if (iop_adma_status(dma_chan, cookie, NULL) != DMA_SUCCESS) { |
1250 | dev_printk(KERN_ERR, dma_chan->device->dev, | 1241 | dev_printk(KERN_ERR, dma_chan->device->dev, |
1251 | "Self-test non-zero sum timed out, disabling\n"); | 1242 | "Self-test non-zero sum timed out, disabling\n"); |
1252 | err = -ENODEV; | 1243 | err = -ENODEV; |
@@ -1341,7 +1332,7 @@ iop_adma_pq_zero_sum_self_test(struct iop_adma_device *device) | |||
1341 | iop_adma_issue_pending(dma_chan); | 1332 | iop_adma_issue_pending(dma_chan); |
1342 | msleep(8); | 1333 | msleep(8); |
1343 | 1334 | ||
1344 | if (iop_adma_is_complete(dma_chan, cookie, NULL, NULL) != | 1335 | if (iop_adma_status(dma_chan, cookie, NULL) != |
1345 | DMA_SUCCESS) { | 1336 | DMA_SUCCESS) { |
1346 | dev_err(dev, "Self-test pq timed out, disabling\n"); | 1337 | dev_err(dev, "Self-test pq timed out, disabling\n"); |
1347 | err = -ENODEV; | 1338 | err = -ENODEV; |
@@ -1378,7 +1369,7 @@ iop_adma_pq_zero_sum_self_test(struct iop_adma_device *device) | |||
1378 | iop_adma_issue_pending(dma_chan); | 1369 | iop_adma_issue_pending(dma_chan); |
1379 | msleep(8); | 1370 | msleep(8); |
1380 | 1371 | ||
1381 | if (iop_adma_is_complete(dma_chan, cookie, NULL, NULL) != | 1372 | if (iop_adma_status(dma_chan, cookie, NULL) != |
1382 | DMA_SUCCESS) { | 1373 | DMA_SUCCESS) { |
1383 | dev_err(dev, "Self-test pq-zero-sum timed out, disabling\n"); | 1374 | dev_err(dev, "Self-test pq-zero-sum timed out, disabling\n"); |
1384 | err = -ENODEV; | 1375 | err = -ENODEV; |
@@ -1410,7 +1401,7 @@ iop_adma_pq_zero_sum_self_test(struct iop_adma_device *device) | |||
1410 | iop_adma_issue_pending(dma_chan); | 1401 | iop_adma_issue_pending(dma_chan); |
1411 | msleep(8); | 1402 | msleep(8); |
1412 | 1403 | ||
1413 | if (iop_adma_is_complete(dma_chan, cookie, NULL, NULL) != | 1404 | if (iop_adma_status(dma_chan, cookie, NULL) != |
1414 | DMA_SUCCESS) { | 1405 | DMA_SUCCESS) { |
1415 | dev_err(dev, "Self-test !pq-zero-sum timed out, disabling\n"); | 1406 | dev_err(dev, "Self-test !pq-zero-sum timed out, disabling\n"); |
1416 | err = -ENODEV; | 1407 | err = -ENODEV; |
@@ -1508,7 +1499,7 @@ static int __devinit iop_adma_probe(struct platform_device *pdev) | |||
1508 | /* set base routines */ | 1499 | /* set base routines */ |
1509 | dma_dev->device_alloc_chan_resources = iop_adma_alloc_chan_resources; | 1500 | dma_dev->device_alloc_chan_resources = iop_adma_alloc_chan_resources; |
1510 | dma_dev->device_free_chan_resources = iop_adma_free_chan_resources; | 1501 | dma_dev->device_free_chan_resources = iop_adma_free_chan_resources; |
1511 | dma_dev->device_is_tx_complete = iop_adma_is_complete; | 1502 | dma_dev->device_tx_status = iop_adma_status; |
1512 | dma_dev->device_issue_pending = iop_adma_issue_pending; | 1503 | dma_dev->device_issue_pending = iop_adma_issue_pending; |
1513 | dma_dev->dev = &pdev->dev; | 1504 | dma_dev->dev = &pdev->dev; |
1514 | 1505 | ||