diff options
Diffstat (limited to 'drivers/dma/ioat')
-rw-r--r-- | drivers/dma/ioat/dma.c | 12 | ||||
-rw-r--r-- | drivers/dma/ioat/dma.h | 18 | ||||
-rw-r--r-- | drivers/dma/ioat/dma_v2.c | 2 | ||||
-rw-r--r-- | drivers/dma/ioat/dma_v3.c | 20 |
4 files changed, 24 insertions, 28 deletions
diff --git a/drivers/dma/ioat/dma.c b/drivers/dma/ioat/dma.c index 3e5a8005c62..c9213ead4a2 100644 --- a/drivers/dma/ioat/dma.c +++ b/drivers/dma/ioat/dma.c | |||
@@ -727,18 +727,18 @@ static void ioat1_timer_event(unsigned long data) | |||
727 | } | 727 | } |
728 | 728 | ||
729 | enum dma_status | 729 | enum dma_status |
730 | ioat_is_dma_complete(struct dma_chan *c, dma_cookie_t cookie, | 730 | ioat_dma_tx_status(struct dma_chan *c, dma_cookie_t cookie, |
731 | dma_cookie_t *done, dma_cookie_t *used) | 731 | struct dma_tx_state *txstate) |
732 | { | 732 | { |
733 | struct ioat_chan_common *chan = to_chan_common(c); | 733 | struct ioat_chan_common *chan = to_chan_common(c); |
734 | struct ioatdma_device *device = chan->device; | 734 | struct ioatdma_device *device = chan->device; |
735 | 735 | ||
736 | if (ioat_is_complete(c, cookie, done, used) == DMA_SUCCESS) | 736 | if (ioat_tx_status(c, cookie, txstate) == DMA_SUCCESS) |
737 | return DMA_SUCCESS; | 737 | return DMA_SUCCESS; |
738 | 738 | ||
739 | device->cleanup_fn((unsigned long) c); | 739 | device->cleanup_fn((unsigned long) c); |
740 | 740 | ||
741 | return ioat_is_complete(c, cookie, done, used); | 741 | return ioat_tx_status(c, cookie, txstate); |
742 | } | 742 | } |
743 | 743 | ||
744 | static void ioat1_dma_start_null_desc(struct ioat_dma_chan *ioat) | 744 | static void ioat1_dma_start_null_desc(struct ioat_dma_chan *ioat) |
@@ -858,7 +858,7 @@ int __devinit ioat_dma_self_test(struct ioatdma_device *device) | |||
858 | tmo = wait_for_completion_timeout(&cmp, msecs_to_jiffies(3000)); | 858 | tmo = wait_for_completion_timeout(&cmp, msecs_to_jiffies(3000)); |
859 | 859 | ||
860 | if (tmo == 0 || | 860 | if (tmo == 0 || |
861 | dma->device_is_tx_complete(dma_chan, cookie, NULL, NULL) | 861 | dma->device_tx_status(dma_chan, cookie, NULL) |
862 | != DMA_SUCCESS) { | 862 | != DMA_SUCCESS) { |
863 | dev_err(dev, "Self-test copy timed out, disabling\n"); | 863 | dev_err(dev, "Self-test copy timed out, disabling\n"); |
864 | err = -ENODEV; | 864 | err = -ENODEV; |
@@ -1199,7 +1199,7 @@ int __devinit ioat1_dma_probe(struct ioatdma_device *device, int dca) | |||
1199 | dma->device_issue_pending = ioat1_dma_memcpy_issue_pending; | 1199 | dma->device_issue_pending = ioat1_dma_memcpy_issue_pending; |
1200 | dma->device_alloc_chan_resources = ioat1_dma_alloc_chan_resources; | 1200 | dma->device_alloc_chan_resources = ioat1_dma_alloc_chan_resources; |
1201 | dma->device_free_chan_resources = ioat1_dma_free_chan_resources; | 1201 | dma->device_free_chan_resources = ioat1_dma_free_chan_resources; |
1202 | dma->device_is_tx_complete = ioat_is_dma_complete; | 1202 | dma->device_tx_status = ioat_dma_tx_status; |
1203 | 1203 | ||
1204 | err = ioat_probe(device); | 1204 | err = ioat_probe(device); |
1205 | if (err) | 1205 | if (err) |
diff --git a/drivers/dma/ioat/dma.h b/drivers/dma/ioat/dma.h index 0c76578e991..6d3a73b57e5 100644 --- a/drivers/dma/ioat/dma.h +++ b/drivers/dma/ioat/dma.h | |||
@@ -143,15 +143,14 @@ static inline struct ioat_dma_chan *to_ioat_chan(struct dma_chan *c) | |||
143 | } | 143 | } |
144 | 144 | ||
145 | /** | 145 | /** |
146 | * ioat_is_complete - poll the status of an ioat transaction | 146 | * ioat_tx_status - poll the status of an ioat transaction |
147 | * @c: channel handle | 147 | * @c: channel handle |
148 | * @cookie: transaction identifier | 148 | * @cookie: transaction identifier |
149 | * @done: if set, updated with last completed transaction | 149 | * @txstate: if set, updated with the transaction state |
150 | * @used: if set, updated with last used transaction | ||
151 | */ | 150 | */ |
152 | static inline enum dma_status | 151 | static inline enum dma_status |
153 | ioat_is_complete(struct dma_chan *c, dma_cookie_t cookie, | 152 | ioat_tx_status(struct dma_chan *c, dma_cookie_t cookie, |
154 | dma_cookie_t *done, dma_cookie_t *used) | 153 | struct dma_tx_state *txstate) |
155 | { | 154 | { |
156 | struct ioat_chan_common *chan = to_chan_common(c); | 155 | struct ioat_chan_common *chan = to_chan_common(c); |
157 | dma_cookie_t last_used; | 156 | dma_cookie_t last_used; |
@@ -160,10 +159,7 @@ ioat_is_complete(struct dma_chan *c, dma_cookie_t cookie, | |||
160 | last_used = c->cookie; | 159 | last_used = c->cookie; |
161 | last_complete = chan->completed_cookie; | 160 | last_complete = chan->completed_cookie; |
162 | 161 | ||
163 | if (done) | 162 | dma_set_tx_state(txstate, last_complete, last_used, 0); |
164 | *done = last_complete; | ||
165 | if (used) | ||
166 | *used = last_used; | ||
167 | 163 | ||
168 | return dma_async_is_complete(cookie, last_complete, last_used); | 164 | return dma_async_is_complete(cookie, last_complete, last_used); |
169 | } | 165 | } |
@@ -339,8 +335,8 @@ struct dca_provider * __devinit ioat_dca_init(struct pci_dev *pdev, | |||
339 | unsigned long ioat_get_current_completion(struct ioat_chan_common *chan); | 335 | unsigned long ioat_get_current_completion(struct ioat_chan_common *chan); |
340 | void ioat_init_channel(struct ioatdma_device *device, | 336 | void ioat_init_channel(struct ioatdma_device *device, |
341 | struct ioat_chan_common *chan, int idx); | 337 | struct ioat_chan_common *chan, int idx); |
342 | enum dma_status ioat_is_dma_complete(struct dma_chan *c, dma_cookie_t cookie, | 338 | enum dma_status ioat_dma_tx_status(struct dma_chan *c, dma_cookie_t cookie, |
343 | dma_cookie_t *done, dma_cookie_t *used); | 339 | struct dma_tx_state *txstate); |
344 | void ioat_dma_unmap(struct ioat_chan_common *chan, enum dma_ctrl_flags flags, | 340 | void ioat_dma_unmap(struct ioat_chan_common *chan, enum dma_ctrl_flags flags, |
345 | size_t len, struct ioat_dma_descriptor *hw); | 341 | size_t len, struct ioat_dma_descriptor *hw); |
346 | bool ioat_cleanup_preamble(struct ioat_chan_common *chan, | 342 | bool ioat_cleanup_preamble(struct ioat_chan_common *chan, |
diff --git a/drivers/dma/ioat/dma_v2.c b/drivers/dma/ioat/dma_v2.c index e75d0299bb8..3c8b32a8379 100644 --- a/drivers/dma/ioat/dma_v2.c +++ b/drivers/dma/ioat/dma_v2.c | |||
@@ -859,7 +859,7 @@ int __devinit ioat2_dma_probe(struct ioatdma_device *device, int dca) | |||
859 | dma->device_issue_pending = ioat2_issue_pending; | 859 | dma->device_issue_pending = ioat2_issue_pending; |
860 | dma->device_alloc_chan_resources = ioat2_alloc_chan_resources; | 860 | dma->device_alloc_chan_resources = ioat2_alloc_chan_resources; |
861 | dma->device_free_chan_resources = ioat2_free_chan_resources; | 861 | dma->device_free_chan_resources = ioat2_free_chan_resources; |
862 | dma->device_is_tx_complete = ioat_is_dma_complete; | 862 | dma->device_tx_status = ioat_tx_status; |
863 | 863 | ||
864 | err = ioat_probe(device); | 864 | err = ioat_probe(device); |
865 | if (err) | 865 | if (err) |
diff --git a/drivers/dma/ioat/dma_v3.c b/drivers/dma/ioat/dma_v3.c index e2a23952172..1cdd22e1051 100644 --- a/drivers/dma/ioat/dma_v3.c +++ b/drivers/dma/ioat/dma_v3.c | |||
@@ -403,17 +403,17 @@ static void ioat3_timer_event(unsigned long data) | |||
403 | } | 403 | } |
404 | 404 | ||
405 | static enum dma_status | 405 | static enum dma_status |
406 | ioat3_is_complete(struct dma_chan *c, dma_cookie_t cookie, | 406 | ioat3_tx_status(struct dma_chan *c, dma_cookie_t cookie, |
407 | dma_cookie_t *done, dma_cookie_t *used) | 407 | struct dma_tx_state *txstate) |
408 | { | 408 | { |
409 | struct ioat2_dma_chan *ioat = to_ioat2_chan(c); | 409 | struct ioat2_dma_chan *ioat = to_ioat2_chan(c); |
410 | 410 | ||
411 | if (ioat_is_complete(c, cookie, done, used) == DMA_SUCCESS) | 411 | if (ioat_tx_status(c, cookie, txstate) == DMA_SUCCESS) |
412 | return DMA_SUCCESS; | 412 | return DMA_SUCCESS; |
413 | 413 | ||
414 | ioat3_cleanup(ioat); | 414 | ioat3_cleanup(ioat); |
415 | 415 | ||
416 | return ioat_is_complete(c, cookie, done, used); | 416 | return ioat_tx_status(c, cookie, txstate); |
417 | } | 417 | } |
418 | 418 | ||
419 | static struct dma_async_tx_descriptor * | 419 | static struct dma_async_tx_descriptor * |
@@ -930,7 +930,7 @@ static int __devinit ioat_xor_val_self_test(struct ioatdma_device *device) | |||
930 | 930 | ||
931 | tmo = wait_for_completion_timeout(&cmp, msecs_to_jiffies(3000)); | 931 | tmo = wait_for_completion_timeout(&cmp, msecs_to_jiffies(3000)); |
932 | 932 | ||
933 | if (dma->device_is_tx_complete(dma_chan, cookie, NULL, NULL) != DMA_SUCCESS) { | 933 | if (dma->device_tx_status(dma_chan, cookie, NULL) != DMA_SUCCESS) { |
934 | dev_err(dev, "Self-test xor timed out\n"); | 934 | dev_err(dev, "Self-test xor timed out\n"); |
935 | err = -ENODEV; | 935 | err = -ENODEV; |
936 | goto free_resources; | 936 | goto free_resources; |
@@ -984,7 +984,7 @@ static int __devinit ioat_xor_val_self_test(struct ioatdma_device *device) | |||
984 | 984 | ||
985 | tmo = wait_for_completion_timeout(&cmp, msecs_to_jiffies(3000)); | 985 | tmo = wait_for_completion_timeout(&cmp, msecs_to_jiffies(3000)); |
986 | 986 | ||
987 | if (dma->device_is_tx_complete(dma_chan, cookie, NULL, NULL) != DMA_SUCCESS) { | 987 | if (dma->device_tx_status(dma_chan, cookie, NULL) != DMA_SUCCESS) { |
988 | dev_err(dev, "Self-test validate timed out\n"); | 988 | dev_err(dev, "Self-test validate timed out\n"); |
989 | err = -ENODEV; | 989 | err = -ENODEV; |
990 | goto free_resources; | 990 | goto free_resources; |
@@ -1025,7 +1025,7 @@ static int __devinit ioat_xor_val_self_test(struct ioatdma_device *device) | |||
1025 | 1025 | ||
1026 | tmo = wait_for_completion_timeout(&cmp, msecs_to_jiffies(3000)); | 1026 | tmo = wait_for_completion_timeout(&cmp, msecs_to_jiffies(3000)); |
1027 | 1027 | ||
1028 | if (dma->device_is_tx_complete(dma_chan, cookie, NULL, NULL) != DMA_SUCCESS) { | 1028 | if (dma->device_tx_status(dma_chan, cookie, NULL) != DMA_SUCCESS) { |
1029 | dev_err(dev, "Self-test memset timed out\n"); | 1029 | dev_err(dev, "Self-test memset timed out\n"); |
1030 | err = -ENODEV; | 1030 | err = -ENODEV; |
1031 | goto free_resources; | 1031 | goto free_resources; |
@@ -1068,7 +1068,7 @@ static int __devinit ioat_xor_val_self_test(struct ioatdma_device *device) | |||
1068 | 1068 | ||
1069 | tmo = wait_for_completion_timeout(&cmp, msecs_to_jiffies(3000)); | 1069 | tmo = wait_for_completion_timeout(&cmp, msecs_to_jiffies(3000)); |
1070 | 1070 | ||
1071 | if (dma->device_is_tx_complete(dma_chan, cookie, NULL, NULL) != DMA_SUCCESS) { | 1071 | if (dma->device_tx_status(dma_chan, cookie, NULL) != DMA_SUCCESS) { |
1072 | dev_err(dev, "Self-test 2nd validate timed out\n"); | 1072 | dev_err(dev, "Self-test 2nd validate timed out\n"); |
1073 | err = -ENODEV; | 1073 | err = -ENODEV; |
1074 | goto free_resources; | 1074 | goto free_resources; |
@@ -1212,11 +1212,11 @@ int __devinit ioat3_dma_probe(struct ioatdma_device *device, int dca) | |||
1212 | 1212 | ||
1213 | 1213 | ||
1214 | if (is_raid_device) { | 1214 | if (is_raid_device) { |
1215 | dma->device_is_tx_complete = ioat3_is_complete; | 1215 | dma->device_tx_status = ioat3_tx_status; |
1216 | device->cleanup_fn = ioat3_cleanup_event; | 1216 | device->cleanup_fn = ioat3_cleanup_event; |
1217 | device->timer_fn = ioat3_timer_event; | 1217 | device->timer_fn = ioat3_timer_event; |
1218 | } else { | 1218 | } else { |
1219 | dma->device_is_tx_complete = ioat_is_dma_complete; | 1219 | dma->device_tx_status = ioat_dma_tx_status; |
1220 | device->cleanup_fn = ioat2_cleanup_event; | 1220 | device->cleanup_fn = ioat2_cleanup_event; |
1221 | device->timer_fn = ioat2_timer_event; | 1221 | device->timer_fn = ioat2_timer_event; |
1222 | } | 1222 | } |