From 91616db7a2ee6495ff1db17b2c11df7a80c7957f Mon Sep 17 00:00:00 2001 From: Paul Walmsley Date: Fri, 24 Aug 2012 06:00:18 +0000 Subject: [PATCH] --- yaml --- r: 322511 b: refs/heads/master c: 75b53aee2f4fe6375c6007226bf68d75b5c4a929 h: refs/heads/master i: 322509: e882b3e27e72530ee3d173a6261d9a6a1a095362 322507: a95d4671dcef259b9f70028d414e6627f768416b 322503: a4976186ce1e4c560a2d8bf7704b4792a9af8589 322495: 8c7009efba8e31d22da3b06ac9b8234fda7549eb v: v3 --- [refs] | 2 +- trunk/drivers/mmc/host/omap.c | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 3c1924eed948..e307a878444c 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 3550ccdb9d8d350e526b809bf3dd92b550a74fe1 +refs/heads/master: 75b53aee2f4fe6375c6007226bf68d75b5c4a929 diff --git a/trunk/drivers/mmc/host/omap.c b/trunk/drivers/mmc/host/omap.c index 50e08f03aa65..a5999a74496a 100644 --- a/trunk/drivers/mmc/host/omap.c +++ b/trunk/drivers/mmc/host/omap.c @@ -668,7 +668,7 @@ mmc_omap_clk_timer(unsigned long data) static void mmc_omap_xfer_data(struct mmc_omap_host *host, int write) { - int n; + int n, nwords; if (host->buffer_bytes_left == 0) { host->sg_idx++; @@ -678,15 +678,23 @@ mmc_omap_xfer_data(struct mmc_omap_host *host, int write) n = 64; if (n > host->buffer_bytes_left) n = host->buffer_bytes_left; + + nwords = n / 2; + nwords += n & 1; /* handle odd number of bytes to transfer */ + host->buffer_bytes_left -= n; host->total_bytes_left -= n; host->data->bytes_xfered += n; if (write) { - __raw_writesw(host->virt_base + OMAP_MMC_REG(host, DATA), host->buffer, n); + __raw_writesw(host->virt_base + OMAP_MMC_REG(host, DATA), + host->buffer, nwords); } else { - __raw_readsw(host->virt_base + OMAP_MMC_REG(host, DATA), host->buffer, n); + __raw_readsw(host->virt_base + OMAP_MMC_REG(host, DATA), + host->buffer, nwords); } + + host->buffer += nwords; } static inline void mmc_omap_report_irq(u16 status)