浏览代码

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>
Mika Westerberg 14 年之前
父节点
当前提交
10d48b3934
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      arch/arm/mach-ep93xx/dma-m2p.c

+ 1 - 1
arch/arm/mach-ep93xx/dma-m2p.c

@@ -276,7 +276,7 @@ static void channel_disable(struct m2p_channel *ch)
 	v &= ~(M2P_CONTROL_STALL_IRQ_EN | M2P_CONTROL_NFB_IRQ_EN);
 	v &= ~(M2P_CONTROL_STALL_IRQ_EN | M2P_CONTROL_NFB_IRQ_EN);
 	m2p_set_control(ch, v);
 	m2p_set_control(ch, v);
 
 
-	while (m2p_channel_state(ch) == STATE_ON)
+	while (m2p_channel_state(ch) >= STATE_ON)
 		cpu_relax();
 		cpu_relax();
 
 
 	m2p_set_control(ch, 0x0);
 	m2p_set_control(ch, 0x0);