sd/sdhci.c: Only reset data_count on new commands
authorPeter Crosthwaite <peter.crosthwaite@xilinx.com>
Mon, 3 Jun 2013 16:17:44 +0000 (17:17 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Mon, 3 Jun 2013 16:17:44 +0000 (17:17 +0100)
commit656f416c65d8ddbfd17500676865f0ac8f960801
treee762e114a358cdb42ce4aa12d30c3c036cce7760
parentb0b7ae6259e96e775315357c813b74e85637bf32
sd/sdhci.c: Only reset data_count on new commands

The data_count variable was being reset on every transfer, including
DMA transfer resumptions. This is incorrect, it should only be set
on a new command.

Manifests as a bug when using ADMA and there is a timer delay between
ADMA frames where the fifo is left in a non empty state.

Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Reviewed-by: Igor Mitsyanko <i.mitsyanko@gmail.com>
Message-id: 15a98609cc32315211b0963091a8efd67522e160.1369370934.git.peter.crosthwaite@xilinx.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/sd/sdhci.c