Skip to content

Commit

Permalink
s3cmci: Fix hangup in do_pio_write()
Browse files Browse the repository at this point in the history
This commit fixes the regression what was added by commit
088a78a "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>
  • Loading branch information
Yauhen Kharuzhy authored and Pierre Ossman committed Feb 18, 2009
1 parent 86a6a87 commit 9942448
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/mmc/host/s3cmci.c
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ static void do_pio_write(struct s3cmci_host *host)

to_ptr = host->base + host->sdidata;

while ((fifo = fifo_free(host))) {
while ((fifo = fifo_free(host)) > 3) {
if (!host->pio_bytes) {
res = get_data_buffer(host, &host->pio_bytes,
&host->pio_ptr);
Expand Down

0 comments on commit 9942448

Please sign in to comment.