Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 099f53cb authored by Dan Williams's avatar Dan Williams
Browse files

async_tx: rename zero_sum to val



'zero_sum' does not properly describe the operation of generating parity
and checking that it validates against an existing buffer.  Change the
name of the operation to 'val' (for 'validate').  This is in
anticipation of the p+q case where it is a requirement to identify the
target parity buffers separately from the source buffers, because the
target parity buffers will not have corresponding pq coefficients.

Reviewed-by: default avatarAndre Noll <maan@systemlinux.org>
Acked-by: default avatarMaciej Sosnowski <maciej.sosnowski@intel.com>
Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
parent fd74ea65
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -65,7 +65,7 @@ memcpy - memory copy between a source and a destination buffer
memset  - fill a destination buffer with a byte value
xor     - xor a series of source buffers and write the result to a
	  destination buffer
xor_zero_sum - xor a series of source buffers and set a flag if the
xor_val - xor a series of source buffers and set a flag if the
	  result is zero.  The implementation attempts to prevent
	  writes to memory

+4 −4
Original line number Diff line number Diff line
@@ -478,7 +478,7 @@ void __init iop13xx_platform_init(void)
			dma_cap_set(DMA_MEMCPY, plat_data->cap_mask);
			dma_cap_set(DMA_XOR, plat_data->cap_mask);
			dma_cap_set(DMA_DUAL_XOR, plat_data->cap_mask);
			dma_cap_set(DMA_ZERO_SUM, plat_data->cap_mask);
			dma_cap_set(DMA_XOR_VAL, plat_data->cap_mask);
			dma_cap_set(DMA_MEMSET, plat_data->cap_mask);
			dma_cap_set(DMA_MEMCPY_CRC32C, plat_data->cap_mask);
			dma_cap_set(DMA_INTERRUPT, plat_data->cap_mask);
@@ -490,7 +490,7 @@ void __init iop13xx_platform_init(void)
			dma_cap_set(DMA_MEMCPY, plat_data->cap_mask);
			dma_cap_set(DMA_XOR, plat_data->cap_mask);
			dma_cap_set(DMA_DUAL_XOR, plat_data->cap_mask);
			dma_cap_set(DMA_ZERO_SUM, plat_data->cap_mask);
			dma_cap_set(DMA_XOR_VAL, plat_data->cap_mask);
			dma_cap_set(DMA_MEMSET, plat_data->cap_mask);
			dma_cap_set(DMA_MEMCPY_CRC32C, plat_data->cap_mask);
			dma_cap_set(DMA_INTERRUPT, plat_data->cap_mask);
@@ -502,13 +502,13 @@ void __init iop13xx_platform_init(void)
			dma_cap_set(DMA_MEMCPY, plat_data->cap_mask);
			dma_cap_set(DMA_XOR, plat_data->cap_mask);
			dma_cap_set(DMA_DUAL_XOR, plat_data->cap_mask);
			dma_cap_set(DMA_ZERO_SUM, plat_data->cap_mask);
			dma_cap_set(DMA_XOR_VAL, plat_data->cap_mask);
			dma_cap_set(DMA_MEMSET, plat_data->cap_mask);
			dma_cap_set(DMA_MEMCPY_CRC32C, plat_data->cap_mask);
			dma_cap_set(DMA_INTERRUPT, plat_data->cap_mask);
			dma_cap_set(DMA_PQ_XOR, plat_data->cap_mask);
			dma_cap_set(DMA_PQ_UPDATE, plat_data->cap_mask);
			dma_cap_set(DMA_PQ_ZERO_SUM, plat_data->cap_mask);
			dma_cap_set(DMA_PQ_VAL, plat_data->cap_mask);
			break;
		}
	}
+1 −1
Original line number Diff line number Diff line
@@ -198,7 +198,7 @@ static int __init iop3xx_adma_cap_init(void)
	dma_cap_set(DMA_INTERRUPT, iop3xx_aau_data.cap_mask);
	#else
	dma_cap_set(DMA_XOR, iop3xx_aau_data.cap_mask);
	dma_cap_set(DMA_ZERO_SUM, iop3xx_aau_data.cap_mask);
	dma_cap_set(DMA_XOR_VAL, iop3xx_aau_data.cap_mask);
	dma_cap_set(DMA_MEMSET, iop3xx_aau_data.cap_mask);
	dma_cap_set(DMA_INTERRUPT, iop3xx_aau_data.cap_mask);
	#endif
+8 −8
Original line number Diff line number Diff line
@@ -222,7 +222,7 @@ static int page_is_zero(struct page *p, unsigned int offset, size_t len)
}

/**
 * async_xor_zero_sum - attempt a xor parity check with a dma engine.
 * async_xor_val - attempt a xor parity check with a dma engine.
 * @dest: destination page used if the xor is performed synchronously
 * @src_list: array of source pages.  The dest page must be listed as a source
 * 	at index zero.  The contents of this array may be overwritten.
@@ -236,13 +236,13 @@ static int page_is_zero(struct page *p, unsigned int offset, size_t len)
 * @cb_param: parameter to pass to the callback routine
 */
struct dma_async_tx_descriptor *
async_xor_zero_sum(struct page *dest, struct page **src_list,
async_xor_val(struct page *dest, struct page **src_list,
	unsigned int offset, int src_cnt, size_t len,
	u32 *result, enum async_tx_flags flags,
	struct dma_async_tx_descriptor *depend_tx,
	dma_async_tx_callback cb_fn, void *cb_param)
{
	struct dma_chan *chan = async_tx_find_channel(depend_tx, DMA_ZERO_SUM,
	struct dma_chan *chan = async_tx_find_channel(depend_tx, DMA_XOR_VAL,
						      &dest, 1, src_list,
						      src_cnt, len);
	struct dma_device *device = chan ? chan->device : NULL;
@@ -261,7 +261,7 @@ async_xor_zero_sum(struct page *dest, struct page **src_list,
			dma_src[i] = dma_map_page(device->dev, src_list[i],
						  offset, len, DMA_TO_DEVICE);

		tx = device->device_prep_dma_zero_sum(chan, dma_src, src_cnt,
		tx = device->device_prep_dma_xor_val(chan, dma_src, src_cnt,
						     len, result,
						     dma_prep_flags);
		if (unlikely(!tx)) {
@@ -269,7 +269,7 @@ async_xor_zero_sum(struct page *dest, struct page **src_list,

			while (!tx) {
				dma_async_issue_pending(chan);
				tx = device->device_prep_dma_zero_sum(chan,
				tx = device->device_prep_dma_xor_val(chan,
					dma_src, src_cnt, len, result,
					dma_prep_flags);
			}
@@ -296,7 +296,7 @@ async_xor_zero_sum(struct page *dest, struct page **src_list,

	return tx;
}
EXPORT_SYMBOL_GPL(async_xor_zero_sum);
EXPORT_SYMBOL_GPL(async_xor_val);

static int __init async_xor_init(void)
{
+2 −2
Original line number Diff line number Diff line
@@ -644,8 +644,8 @@ int dma_async_device_register(struct dma_device *device)
		!device->device_prep_dma_memcpy);
	BUG_ON(dma_has_cap(DMA_XOR, device->cap_mask) &&
		!device->device_prep_dma_xor);
	BUG_ON(dma_has_cap(DMA_ZERO_SUM, device->cap_mask) &&
		!device->device_prep_dma_zero_sum);
	BUG_ON(dma_has_cap(DMA_XOR_VAL, device->cap_mask) &&
		!device->device_prep_dma_xor_val);
	BUG_ON(dma_has_cap(DMA_MEMSET, device->cap_mask) &&
		!device->device_prep_dma_memset);
	BUG_ON(dma_has_cap(DMA_INTERRUPT, device->cap_mask) &&
Loading