diff options
author | Dan Williams <dan.j.williams@intel.com> | 2009-12-17 21:52:39 +0100 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2009-12-17 21:52:39 +0100 |
commit | cd78809f6191485a90ea6c92c2b58900ab5c156f (patch) | |
tree | d17a0e30178ec8ae78e04df69ca3d7b280054361 /drivers/dma | |
parent | Linux 2.6.32 (diff) | |
download | linux-cd78809f6191485a90ea6c92c2b58900ab5c156f.tar.xz linux-cd78809f6191485a90ea6c92c2b58900ab5c156f.zip |
ioat3: fix p-disabled q-continuation
When continuing a pq calculation the driver needs 3 extra sources. The
driver can perform a 3 source calculation with a single descriptor, but
needs an extended descriptor to process up to 8 sources in one
operation. However, in the p-disabled case only one extra source is
needed. When continuing a p-disabled operation there are occasions
(i.e. 0 < src_cnt % 8 < 3) where the tail operation does not need an
extended descriptor. Properly account for this fact otherwise invalid
'dmacount' values will be written to hardware usually causing the
channel to halt with 'invalid descriptor' errors.
Cc: <stable@kernel.org>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/dma')
-rw-r--r-- | drivers/dma/ioat/dma_v3.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/dma/ioat/dma_v3.c b/drivers/dma/ioat/dma_v3.c index 42f6f10fb0cc..e58ecb29513f 100644 --- a/drivers/dma/ioat/dma_v3.c +++ b/drivers/dma/ioat/dma_v3.c @@ -650,9 +650,11 @@ __ioat3_prep_pq_lock(struct dma_chan *c, enum sum_check_flags *result, num_descs = ioat2_xferlen_to_descs(ioat, len); /* we need 2x the number of descriptors to cover greater than 3 - * sources + * sources (we need 1 extra source in the q-only continuation + * case and 3 extra sources in the p+q continuation case. */ - if (src_cnt > 3 || flags & DMA_PREP_CONTINUE) { + if (src_cnt + dmaf_p_disabled_continue(flags) > 3 || + (dmaf_continue(flags) && !dmaf_p_disabled_continue(flags))) { with_ext = 1; num_descs *= 2; } else |