ASoC: Intel: Skylake: Fix CLDMA buffer wrap case
authorJeeja KP <jeeja.kp@intel.com>
Fri, 13 Nov 2015 13:52:10 +0000 (19:22 +0530)
committerMark Brown <broonie@kernel.org>
Wed, 18 Nov 2015 18:46:36 +0000 (18:46 +0000)
commite797af53b8814dfbc3c6ac134c528b8ab480f275
tree7398ed99adc690aeb3f4b4aa5f614854f15a44a7
parent53afce2c5764ebf5e933efe9a2dd58cbc316c854
ASoC: Intel: Skylake: Fix CLDMA buffer wrap case

When downloading the firmware/module, if the ring buffer boundary
is reached, we need to wrap to the zeroth position. On next copy
we need to copy till end of buffer and the remaining buffer needs
to be copied from zeroth position.

In this case copy was not handled correctly when wrap condition
is reached which caused invalid data to be copied resulting in
invalid hash failure.

This patch fixes the issue by handling copy at the boundary
condition correctly.

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/intel/skylake/skl-sst-cldma.c