ioat3: fix p-disabled q-continuation
authorDan Williams <dan.j.williams@intel.com>
Thu, 17 Dec 2009 20:52:39 +0000 (13:52 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 6 Jan 2010 23:03:58 +0000 (15:03 -0800)
commite05a6f0307a79b77319eed3c892a9c09613f1a28
tree82f66825ac7f730ae0b0b6745f54f399cdad12bc
parente93166f10c741f247c7e172936811bad558b4135
ioat3: fix p-disabled q-continuation

commit cd78809f6191485a90ea6c92c2b58900ab5c156f upstream.

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.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/dma/ioat/dma_v3.c