summaryrefslogtreecommitdiff
path: root/drivers/mmc/host/mvsdio.c
diff options
context:
space:
mode:
authorNicolas Pitre <nico@cam.org>2009-07-18 20:34:37 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-07-20 16:46:34 -0700
commit6cdbf734493d6e8f5afc6f539b82897772809d43 (patch)
tree4d1678ef1712c91990146d6e0beb33109901beea /drivers/mmc/host/mvsdio.c
parent0ecf24ef49d4f46ff5d6af357c3b9ec8d798160d (diff)
downloadlwn-6cdbf734493d6e8f5afc6f539b82897772809d43.tar.gz
lwn-6cdbf734493d6e8f5afc6f539b82897772809d43.zip
mvsdio: fix handling of partial word at the end of PIO transfer
Standard data flow for MMC/SD/SDIO cards requires that the mvsdio controller be set for big endian operation. This is causing problems with buffers which length is not a multiple of 4 bytes as the last partial word doesn't get shifted all the way and stored properly in memory. Let's compensate for this. Signed-off-by: Nicolas Pitre <nico@marvell.com> CC: stable@kernel.org Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/mmc/host/mvsdio.c')
-rw-r--r--drivers/mmc/host/mvsdio.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/mmc/host/mvsdio.c b/drivers/mmc/host/mvsdio.c
index b56d72ff06e9..34e23489811a 100644
--- a/drivers/mmc/host/mvsdio.c
+++ b/drivers/mmc/host/mvsdio.c
@@ -384,7 +384,7 @@ static irqreturn_t mvsd_irq(int irq, void *dev)
u16 val[2] = {0, 0};
val[0] = mvsd_read(MVSD_FIFO);
val[1] = mvsd_read(MVSD_FIFO);
- memcpy(p, &val, s);
+ memcpy(p, ((void *)&val) + 4 - s, s);
s = 0;
intr_status = mvsd_read(MVSD_NOR_INTR_STATUS);
}
@@ -423,7 +423,7 @@ static irqreturn_t mvsd_irq(int irq, void *dev)
if (s < 4) {
if (s && (intr_status & MVSD_NOR_TX_AVAIL)) {
u16 val[2] = {0, 0};
- memcpy(&val, p, s);
+ memcpy(((void *)&val) + 4 - s, p, s);
mvsd_write(MVSD_FIFO, val[0]);
mvsd_write(MVSD_FIFO, val[1]);
s = 0;