summaryrefslogtreecommitdiff
path: root/drivers/mxc/ipu3/ipu_common.c
diff options
context:
space:
mode:
authorJason Chen <b02280@freescale.com>2009-10-19 14:15:16 +0800
committerAlejandro Gonzalez <alex.gonzalez@digi.com>2010-02-12 17:19:24 +0100
commit4aabb0e51c2ad87dd3aedc73390af4e8d0cda78b (patch)
tree1f24c48def962c78626bfe43d410f70cfe751e77 /drivers/mxc/ipu3/ipu_common.c
parent7a7f043a0f0f52c3f49b27cc1c0ef0f864a7597b (diff)
ENGR00117388 ipuv3: Futher fix for diable IPU channel
IPU channel disable should wait all channels finish busy state, should wait for input dma interrupt first then output dma interrupt as the correct sequence for all channels. This patch fix the DQ_BUF fail issue in VPU unit test. Signed-off-by: Jason Chen <b02280@freescale.com>
Diffstat (limited to 'drivers/mxc/ipu3/ipu_common.c')
-rw-r--r--drivers/mxc/ipu3/ipu_common.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/mxc/ipu3/ipu_common.c b/drivers/mxc/ipu3/ipu_common.c
index 95387b00b2d1..6cb5345827b3 100644
--- a/drivers/mxc/ipu3/ipu_common.c
+++ b/drivers/mxc/ipu3/ipu_common.c
@@ -1662,16 +1662,27 @@ int32_t ipu_disable_channel(ipu_channel_t channel, bool wait_for_stop)
(channel == MEM_DC_SYNC)) {
_ipu_dp_dc_disable(channel, false);
} else if (wait_for_stop) {
- if (idma_is_set(IDMAC_CHA_BUSY, in_dma) ||
+ while (idma_is_set(IDMAC_CHA_BUSY, in_dma) ||
idma_is_set(IDMAC_CHA_BUSY, out_dma) ||
(g_sec_chan_en[IPU_CHAN_ID(channel)] &&
idma_is_set(IDMAC_CHA_BUSY, sec_dma)) ||
(g_thrd_chan_en[IPU_CHAN_ID(channel)] &&
idma_is_set(IDMAC_CHA_BUSY, thrd_dma)) ||
(_ipu_channel_status(channel) == TASK_STAT_ACTIVE)) {
- uint32_t ret, irq = in_dma;
+ uint32_t ret, irq = out_dma;
DECLARE_COMPLETION_ONSTACK(disable_comp);
+ if (idma_is_set(IDMAC_CHA_BUSY, out_dma))
+ irq = out_dma;
+ if (g_sec_chan_en[IPU_CHAN_ID(channel)] &&
+ idma_is_set(IDMAC_CHA_BUSY, sec_dma))
+ irq = sec_dma;
+ if (g_thrd_chan_en[IPU_CHAN_ID(channel)] &&
+ idma_is_set(IDMAC_CHA_BUSY, thrd_dma))
+ irq = thrd_dma;
+ if (idma_is_set(IDMAC_CHA_BUSY, in_dma))
+ irq = in_dma;
+
ret = ipu_request_irq(irq, disable_chan_irq_handler, 0, NULL, &disable_comp);
if (ret < 0) {
dev_err(g_ipu_dev, "irq %d in use\n", irq);