ARM: 6642/1: mmci: calculate remaining bytes at error correctly

The MMCIDATACNT register contain the number of byte left at error
not the number of words, so loose the << 2 thing. Further if CRC
fails on the first block, we may end up with a negative number
of transferred bytes which is not good, and the formula was in
wrong order.

Signed-off-by: Linus Walleij <linus.walleij@stericsson.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

authored by Linus Walleij and committed by Russell King f5a106d9 bffb276f

+2 -2
+2 -2
drivers/mmc/host/mmci.c
··· 283 u32 remain, success; 284 285 /* Calculate how far we are into the transfer */ 286 - remain = readl(host->base + MMCIDATACNT) << 2; 287 success = data->blksz * data->blocks - remain; 288 289 dev_dbg(mmc_dev(host->mmc), "MCI ERROR IRQ (status %08x)\n", status); 290 if (status & MCI_DATACRCFAIL) { 291 /* Last block was not successful */ 292 - host->data_xfered = ((success / data->blksz) - 1 * data->blksz); 293 data->error = -EILSEQ; 294 } else if (status & MCI_DATATIMEOUT) { 295 host->data_xfered = success;
··· 283 u32 remain, success; 284 285 /* Calculate how far we are into the transfer */ 286 + remain = readl(host->base + MMCIDATACNT); 287 success = data->blksz * data->blocks - remain; 288 289 dev_dbg(mmc_dev(host->mmc), "MCI ERROR IRQ (status %08x)\n", status); 290 if (status & MCI_DATACRCFAIL) { 291 /* Last block was not successful */ 292 + host->data_xfered = ((success - 1) / data->blksz) * data->blksz; 293 data->error = -EILSEQ; 294 } else if (status & MCI_DATATIMEOUT) { 295 host->data_xfered = success;