diff options
author | Dan Williams <dan.j.williams@intel.com> | 2008-04-17 23:17:26 -0400 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2008-04-17 16:25:54 -0400 |
commit | 636bdeaa1243327501edfd2a597ed7443eb4239a (patch) | |
tree | 59b894f124e3664ea4a537d7c07c527abdb9c8da /crypto/async_tx | |
parent | c4fe15541d0ef5cc8cc1ce43057663851f8fc387 (diff) |
dmaengine: ack to flags: make use of the unused bits in the 'ack' field
'ack' is currently a simple integer that flags whether or not a client is done
touching fields in the given descriptor. It is effectively just a single bit
of information. Converting this to a flags parameter allows the other bits to
be put to use to control completion actions, like dma-unmap, and capture
results, like xor-zero-sum == 0.
Changes are one of:
1/ convert all open-coded ->ack manipulations to use async_tx_ack
and async_tx_test_ack.
2/ set the ack bit at prep time where possible
3/ make drivers store the flags at prep time
4/ add flags to the device_prep_dma_interrupt prototype
Acked-by: Maciej Sosnowski <maciej.sosnowski@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'crypto/async_tx')
-rw-r--r-- | crypto/async_tx/async_memcpy.c | 2 | ||||
-rw-r--r-- | crypto/async_tx/async_tx.c | 9 | ||||
-rw-r--r-- | crypto/async_tx/async_xor.c | 2 |
3 files changed, 7 insertions, 6 deletions
diff --git a/crypto/async_tx/async_memcpy.c b/crypto/async_tx/async_memcpy.c index 84caa4efc0d4..a5eda80e8427 100644 --- a/crypto/async_tx/async_memcpy.c +++ b/crypto/async_tx/async_memcpy.c | |||
@@ -77,7 +77,7 @@ async_memcpy(struct page *dest, struct page *src, unsigned int dest_offset, | |||
77 | /* if ack is already set then we cannot be sure | 77 | /* if ack is already set then we cannot be sure |
78 | * we are referring to the correct operation | 78 | * we are referring to the correct operation |
79 | */ | 79 | */ |
80 | BUG_ON(depend_tx->ack); | 80 | BUG_ON(async_tx_test_ack(depend_tx)); |
81 | if (dma_wait_for_async_tx(depend_tx) == DMA_ERROR) | 81 | if (dma_wait_for_async_tx(depend_tx) == DMA_ERROR) |
82 | panic("%s: DMA_ERROR waiting for depend_tx\n", | 82 | panic("%s: DMA_ERROR waiting for depend_tx\n", |
83 | __func__); | 83 | __func__); |
diff --git a/crypto/async_tx/async_tx.c b/crypto/async_tx/async_tx.c index 69756164b61d..c6e772fc5ccd 100644 --- a/crypto/async_tx/async_tx.c +++ b/crypto/async_tx/async_tx.c | |||
@@ -446,7 +446,7 @@ async_tx_channel_switch(struct dma_async_tx_descriptor *depend_tx, | |||
446 | * otherwise poll for completion | 446 | * otherwise poll for completion |
447 | */ | 447 | */ |
448 | if (dma_has_cap(DMA_INTERRUPT, device->cap_mask)) | 448 | if (dma_has_cap(DMA_INTERRUPT, device->cap_mask)) |
449 | intr_tx = device->device_prep_dma_interrupt(chan); | 449 | intr_tx = device->device_prep_dma_interrupt(chan, 0); |
450 | else | 450 | else |
451 | intr_tx = NULL; | 451 | intr_tx = NULL; |
452 | 452 | ||
@@ -515,7 +515,8 @@ async_tx_submit(struct dma_chan *chan, struct dma_async_tx_descriptor *tx, | |||
515 | * 2/ dependencies are 1:1 i.e. two transactions can | 515 | * 2/ dependencies are 1:1 i.e. two transactions can |
516 | * not depend on the same parent | 516 | * not depend on the same parent |
517 | */ | 517 | */ |
518 | BUG_ON(depend_tx->ack || depend_tx->next || tx->parent); | 518 | BUG_ON(async_tx_test_ack(depend_tx) || depend_tx->next || |
519 | tx->parent); | ||
519 | 520 | ||
520 | /* the lock prevents async_tx_run_dependencies from missing | 521 | /* the lock prevents async_tx_run_dependencies from missing |
521 | * the setting of ->next when ->parent != NULL | 522 | * the setting of ->next when ->parent != NULL |
@@ -594,7 +595,7 @@ async_trigger_callback(enum async_tx_flags flags, | |||
594 | if (device && !dma_has_cap(DMA_INTERRUPT, device->cap_mask)) | 595 | if (device && !dma_has_cap(DMA_INTERRUPT, device->cap_mask)) |
595 | device = NULL; | 596 | device = NULL; |
596 | 597 | ||
597 | tx = device ? device->device_prep_dma_interrupt(chan) : NULL; | 598 | tx = device ? device->device_prep_dma_interrupt(chan, 0) : NULL; |
598 | } else | 599 | } else |
599 | tx = NULL; | 600 | tx = NULL; |
600 | 601 | ||
@@ -610,7 +611,7 @@ async_trigger_callback(enum async_tx_flags flags, | |||
610 | /* if ack is already set then we cannot be sure | 611 | /* if ack is already set then we cannot be sure |
611 | * we are referring to the correct operation | 612 | * we are referring to the correct operation |
612 | */ | 613 | */ |
613 | BUG_ON(depend_tx->ack); | 614 | BUG_ON(async_tx_test_ack(depend_tx)); |
614 | if (dma_wait_for_async_tx(depend_tx) == DMA_ERROR) | 615 | if (dma_wait_for_async_tx(depend_tx) == DMA_ERROR) |
615 | panic("%s: DMA_ERROR waiting for depend_tx\n", | 616 | panic("%s: DMA_ERROR waiting for depend_tx\n", |
616 | __func__); | 617 | __func__); |
diff --git a/crypto/async_tx/async_xor.c b/crypto/async_tx/async_xor.c index 1c445c7bdab7..3a0dddca5a10 100644 --- a/crypto/async_tx/async_xor.c +++ b/crypto/async_tx/async_xor.c | |||
@@ -191,7 +191,7 @@ async_xor(struct page *dest, struct page **src_list, unsigned int offset, | |||
191 | /* if ack is already set then we cannot be sure | 191 | /* if ack is already set then we cannot be sure |
192 | * we are referring to the correct operation | 192 | * we are referring to the correct operation |
193 | */ | 193 | */ |
194 | BUG_ON(depend_tx->ack); | 194 | BUG_ON(async_tx_test_ack(depend_tx)); |
195 | if (dma_wait_for_async_tx(depend_tx) == | 195 | if (dma_wait_for_async_tx(depend_tx) == |
196 | DMA_ERROR) | 196 | DMA_ERROR) |
197 | panic("%s: DMA_ERROR waiting for " | 197 | panic("%s: DMA_ERROR waiting for " |