aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
authorYauhen Kharuzhy <jekhor@gmail.com>2009-02-11 16:25:52 -0500
committerPierre Ossman <drzeus@drzeus.cx>2009-02-18 14:56:04 -0500
commit994244883739e4044bef76d4e5d7a9b66dc6c7b6 (patch)
treee7e90dec7e5d20a362de132313b8e7c1c653e7cc /drivers/mmc
parent86a6a8749d5b8fd5c2b544fe9fd11101e3d0550f (diff)
s3cmci: Fix hangup in do_pio_write()
This commit fixes the regression what was added by commit 088a78af978d0c8e339071a9b2bca1f4cb368f30 "s3cmci: Support transfers which are not multiple of 32 bits." fifo_free() now returns amount of available space in FIFO buffer in bytes. But do_pio_write() writes to FIFO 32-bit words. Condition for return from cycle is (fifo_free() == 0), but when fifo has 1..3 bytes of free space then this condition will never be true and system hangs. This patch changes condition in the while() to (fifo_free() > 3). Signed-off-by: Yauhen Kharuzhy <jekhor@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/s3cmci.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mmc/host/s3cmci.c b/drivers/mmc/host/s3cmci.c
index 35a98eec7414..f4a67c65d301 100644
--- a/drivers/mmc/host/s3cmci.c
+++ b/drivers/mmc/host/s3cmci.c
@@ -329,7 +329,7 @@ static void do_pio_write(struct s3cmci_host *host)
329 329
330 to_ptr = host->base + host->sdidata; 330 to_ptr = host->base + host->sdidata;
331 331
332 while ((fifo = fifo_free(host))) { 332 while ((fifo = fifo_free(host)) > 3) {
333 if (!host->pio_bytes) { 333 if (!host->pio_bytes) {
334 res = get_data_buffer(host, &host->pio_bytes, 334 res = get_data_buffer(host, &host->pio_bytes,
335 &host->pio_ptr); 335 &host->pio_ptr);