ARM: 6440/1: ep93xx: DMA: fix channel_disable
authorMika Westerberg <mika.westerberg@iki.fi>
Tue, 12 Oct 2010 09:37:59 +0000 (10:37 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Tue, 12 Oct 2010 21:43:19 +0000 (22:43 +0100)
commit10d48b3934940c178635413b5128c33bc17abe1d
tree60b4ae5c63da00a885130313315b49d3a5f9db7c
parentc0bb5862a9076992e2cbeb5fa0d08c2ac3d4fbb0
ARM: 6440/1: ep93xx: DMA: fix channel_disable

When channel_disable() is called, it disables per channel interrupts and
waits until channels state becomes STATE_STALL, and then disables the
channel. Now, if the DMA transfer is disabled while the channel is in
STATE_NEXT we will not wait anything and disable the channel immediately.
This seems to cause weird data corruption for example in audio transfers.

Fix is to wait while we are in STATE_NEXT or STATE_ON and only then
disable the channel.

Signed-off-by: Mika Westerberg <mika.westerberg@iki.fi>
Acked-by: Ryan Mallon <ryan@bluewatersys.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/mach-ep93xx/dma-m2p.c