diff options
author | Anatolij Gustschin <agust@denx.de> | 2010-02-15 16:35:23 -0500 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2010-03-01 00:18:36 -0500 |
commit | 94de648d72c8bc833590523f22386d4babbea988 (patch) | |
tree | 8507157200c687012e13da8a5ea5088528c0151f /drivers/dma/dmatest.c | |
parent | 76bd061f5c7b7550cdaed68ad6219ea7cee288fc (diff) |
dmatest: correct raid6 PQ test
The number of PQ sources specified by module parameter "pq_sources"
is always forced odd to fit into dmatest's destination verificaton
scheme. But number of PQ sources and coefficients as passed to the
driver's prep_dma_pq() is not adjusted accordingly.
Fix it now to get correct PQ testing results in the case passed
"pq_sources" parameter is even.
Signed-off-by: Anatolij Gustschin <agust@denx.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Maciej Sosnowski <maciej.sosnowski@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/dma/dmatest.c')
-rw-r--r-- | drivers/dma/dmatest.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/dma/dmatest.c b/drivers/dma/dmatest.c index 8b905161fbf4..cc0f3294a766 100644 --- a/drivers/dma/dmatest.c +++ b/drivers/dma/dmatest.c | |||
@@ -237,7 +237,7 @@ static int dmatest_func(void *data) | |||
237 | dma_cookie_t cookie; | 237 | dma_cookie_t cookie; |
238 | enum dma_status status; | 238 | enum dma_status status; |
239 | enum dma_ctrl_flags flags; | 239 | enum dma_ctrl_flags flags; |
240 | u8 pq_coefs[pq_sources]; | 240 | u8 pq_coefs[pq_sources + 1]; |
241 | int ret; | 241 | int ret; |
242 | int src_cnt; | 242 | int src_cnt; |
243 | int dst_cnt; | 243 | int dst_cnt; |
@@ -257,7 +257,7 @@ static int dmatest_func(void *data) | |||
257 | } else if (thread->type == DMA_PQ) { | 257 | } else if (thread->type == DMA_PQ) { |
258 | src_cnt = pq_sources | 1; /* force odd to ensure dst = src */ | 258 | src_cnt = pq_sources | 1; /* force odd to ensure dst = src */ |
259 | dst_cnt = 2; | 259 | dst_cnt = 2; |
260 | for (i = 0; i < pq_sources; i++) | 260 | for (i = 0; i < src_cnt; i++) |
261 | pq_coefs[i] = 1; | 261 | pq_coefs[i] = 1; |
262 | } else | 262 | } else |
263 | goto err_srcs; | 263 | goto err_srcs; |
@@ -355,7 +355,7 @@ static int dmatest_func(void *data) | |||
355 | for (i = 0; i < dst_cnt; i++) | 355 | for (i = 0; i < dst_cnt; i++) |
356 | dma_pq[i] = dma_dsts[i] + dst_off; | 356 | dma_pq[i] = dma_dsts[i] + dst_off; |
357 | tx = dev->device_prep_dma_pq(chan, dma_pq, dma_srcs, | 357 | tx = dev->device_prep_dma_pq(chan, dma_pq, dma_srcs, |
358 | pq_sources, pq_coefs, | 358 | src_cnt, pq_coefs, |
359 | len, flags); | 359 | len, flags); |
360 | } | 360 | } |
361 | 361 | ||