dmaengine: hsu: correct residue calculation of active descriptor
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Fri, 18 Mar 2016 12:26:33 +0000 (14:26 +0200)
committerVinod Koul <vinod.koul@intel.com>
Mon, 4 Apr 2016 16:41:43 +0000 (09:41 -0700)
commita197f3c7d48c0c1f45076ea47533a76ba9b1a959
tree15a03b790467c8d417e5bfe6714d686b0122d1c9
parent080edf75d337d35faa6fc3df99342b10d2848d16
dmaengine: hsu: correct residue calculation of active descriptor

The commit f0579c8ceaf1 ("dmaengine: hsu: speed up residue calculation")
speeded up calculation of the queued descriptor but broke the initial residue
value for active descriptor.

In accordance with documentation the hardware descriptor is updated each time
DMA transfered some bytes. It means we have to calculate a sum of lengths of
non-submitted hardware descriptors and whatever current values in the hardware.
Do this straightforward.

Fixes: f0579c8ceaf1 ("dmaengine: hsu: speed up residue calculation")
Cc: stable@vger.kernel.org
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
drivers/dma/hsu/hsu.c