mmc: msm_sdcc: Fix wrong update of transfer remain variable
The value returned by the msmsdcc_pio_read() will be a 32bit
aligned value, which could be more than what we have requested
to read due to alignment force. Make sure that
host->curr.xfer_remain is updated with correct value.
Change-Id: I8fe1ec7b51626c53d39fe392122f357a3a8db8e2
Signed-off-by: Sujit Reddy Thumma <sthumma@codeaurora.org>
diff --git a/drivers/mmc/host/msm_sdcc.c b/drivers/mmc/host/msm_sdcc.c
index db83404..cdfe10e 100644
--- a/drivers/mmc/host/msm_sdcc.c
+++ b/drivers/mmc/host/msm_sdcc.c
@@ -1265,6 +1265,9 @@
len = msmsdcc_pio_read(host, buffer, remain);
if (status & MCI_TXACTIVE)
len = msmsdcc_pio_write(host, buffer, remain);
+ /* len might have aligned to 32bits above */
+ if (len > remain)
+ len = remain;
/* Unmap the buffer */
kunmap_atomic(buffer, KM_BIO_SRC_IRQ);