diff options
author | Nicolas Pitre <nico@cam.org> | 2009-07-18 20:34:37 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-07-20 19:46:34 -0400 |
commit | 6cdbf734493d6e8f5afc6f539b82897772809d43 (patch) | |
tree | 4d1678ef1712c91990146d6e0beb33109901beea /drivers/mmc/host/mvsdio.c | |
parent | 0ecf24ef49d4f46ff5d6af357c3b9ec8d798160d (diff) |
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.c | 4 |
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) | |||
384 | u16 val[2] = {0, 0}; | 384 | u16 val[2] = {0, 0}; |
385 | val[0] = mvsd_read(MVSD_FIFO); | 385 | val[0] = mvsd_read(MVSD_FIFO); |
386 | val[1] = mvsd_read(MVSD_FIFO); | 386 | val[1] = mvsd_read(MVSD_FIFO); |
387 | memcpy(p, &val, s); | 387 | memcpy(p, ((void *)&val) + 4 - s, s); |
388 | s = 0; | 388 | s = 0; |
389 | intr_status = mvsd_read(MVSD_NOR_INTR_STATUS); | 389 | intr_status = mvsd_read(MVSD_NOR_INTR_STATUS); |
390 | } | 390 | } |
@@ -423,7 +423,7 @@ static irqreturn_t mvsd_irq(int irq, void *dev) | |||
423 | if (s < 4) { | 423 | if (s < 4) { |
424 | if (s && (intr_status & MVSD_NOR_TX_AVAIL)) { | 424 | if (s && (intr_status & MVSD_NOR_TX_AVAIL)) { |
425 | u16 val[2] = {0, 0}; | 425 | u16 val[2] = {0, 0}; |
426 | memcpy(&val, p, s); | 426 | memcpy(((void *)&val) + 4 - s, p, s); |
427 | mvsd_write(MVSD_FIFO, val[0]); | 427 | mvsd_write(MVSD_FIFO, val[0]); |
428 | mvsd_write(MVSD_FIFO, val[1]); | 428 | mvsd_write(MVSD_FIFO, val[1]); |
429 | s = 0; | 429 | s = 0; |