[PATCH 03/17] mmc: tmio: Fix odd size access

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Shinobu Uehara <shinobu.uehara.xc@xxxxxxxxxxx>

Current sd_ctrl_read/write16_rep() doesn't care odd size

Signed-off-by: Shinobu Uehara <shinobu.uehara.xc@xxxxxxxxxxx>
Signed-off-by: Ryo Kataoka <ryo.kataoka.wt@xxxxxxxxxxx>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@xxxxxxxxxxx>
---
 drivers/mmc/host/tmio_mmc_pio.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index b380225..05ae15c 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -386,9 +386,11 @@ static void tmio_mmc_pio_irq(struct tmio_mmc_host *host)
 
 	/* Transfer the data */
 	if (data->flags & MMC_DATA_READ)
-		sd_ctrl_read16_rep(host, CTL_SD_DATA_PORT, buf, count >> 1);
+		sd_ctrl_read16_rep(host,
+			CTL_SD_DATA_PORT, buf, (count + 1) >> 1);
 	else
-		sd_ctrl_write16_rep(host, CTL_SD_DATA_PORT, buf, count >> 1);
+		sd_ctrl_write16_rep(host,
+			CTL_SD_DATA_PORT, buf, (count + 1) >> 1);
 
 	host->sg_off += count;
 
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux