Skip to content

Commit

Permalink
ARM: 6440/1: ep93xx: DMA: fix channel_disable
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Ryan Mallon <[email protected]>
Signed-off-by: Russell King <[email protected]>
  • Loading branch information
Mika Westerberg authored and Russell King committed Oct 12, 2010
1 parent c0bb586 commit 10d48b3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/arm/mach-ep93xx/dma-m2p.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ static void channel_disable(struct m2p_channel *ch)
v &= ~(M2P_CONTROL_STALL_IRQ_EN | M2P_CONTROL_NFB_IRQ_EN);
m2p_set_control(ch, v);

while (m2p_channel_state(ch) == STATE_ON)
while (m2p_channel_state(ch) >= STATE_ON)
cpu_relax();

m2p_set_control(ch, 0x0);
Expand Down

0 comments on commit 10d48b3

Please sign in to comment.