s3cmci: Fix hangup in do_pio_write()
commiteb7a5de8c9ca3e88744ca2623c421d46224473ed
authorYauhen Kharuzhy <jekhor@gmail.com>
Wed, 11 Feb 2009 21:25:52 +0000 (11 13:25 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 17 Mar 2009 00:32:20 +0000 (16 17:32 -0700)
tree79a3d687eb311a0cfb9fd63de6ad828a7d9e955a
parentb00d31ddc7e801763a1c4f009246435153e29bdb
s3cmci: Fix hangup in do_pio_write()

commit 994244883739e4044bef76d4e5d7a9b66dc6c7b6 upstream.

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>
drivers/mmc/host/s3cmci.c