diff options
author | Jason Chen <b02280@freescale.com> | 2011-09-09 17:53:24 +0800 |
---|---|---|
committer | Frank Li <Frank.Li@freescale.com> | 2011-09-15 14:05:14 +0800 |
commit | 45158d76fd07fa566e0b65883fea8fa71f886507 (patch) | |
tree | 59dd3487c72141ce719f51031878019d68dbd6b9 /drivers | |
parent | c449fac279d116a425f87952defb466c5fc289cd (diff) |
ENGR00156374 ipuv3: check channel busy while wait disable irq
there is chance channel already quit busy before wait disable
irq in ipu_disable_channel, so add check during irq wait.
this patch also comments f_calc and m_calc fix build warning.
Signed-off-by: Jason Chen <b02280@freescale.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mxc/ipu3/ipu_calc_stripes_sizes.c | 6 | ||||
-rw-r--r-- | drivers/mxc/ipu3/ipu_common.c | 14 | ||||
-rw-r--r-- | drivers/mxc/ipu3/ipu_disp.c | 18 |
3 files changed, 21 insertions, 17 deletions
diff --git a/drivers/mxc/ipu3/ipu_calc_stripes_sizes.c b/drivers/mxc/ipu3/ipu_calc_stripes_sizes.c index 8c13a36312b6..9a50794f4c91 100644 --- a/drivers/mxc/ipu3/ipu_calc_stripes_sizes.c +++ b/drivers/mxc/ipu3/ipu_calc_stripes_sizes.c @@ -52,8 +52,8 @@ static u32 truncate(u32 up, /* 0: down; else: up */ return d; } -static unsigned int f_calc(unsigned int pfs, unsigned int bpp, unsigned int *write) -{/* return input_f */ +/*static unsigned int f_calc(unsigned int pfs, unsigned int bpp, unsigned int *write) +{[> return input_f <] unsigned int f_calculated = 0; switch (pfs) { case IPU_PIX_FMT_YVU422P: @@ -129,7 +129,7 @@ static unsigned int m_calc(unsigned int pfs) } return m_calculated; -} +}*/ /* Stripe parameters calculator */ diff --git a/drivers/mxc/ipu3/ipu_common.c b/drivers/mxc/ipu3/ipu_common.c index 8159076d3d1a..c8a6136bfdc0 100644 --- a/drivers/mxc/ipu3/ipu_common.c +++ b/drivers/mxc/ipu3/ipu_common.c @@ -2161,7 +2161,7 @@ int32_t ipu_disable_channel(struct ipu_soc *ipu, ipu_channel_t channel, bool wai * wait for BG channel EOF then disable FG-IDMAC, * it avoid FG NFB4EOF error. */ - if (channel == MEM_FG_SYNC) { + if ((channel == MEM_FG_SYNC) && (ipu_is_channel_busy(ipu, MEM_BG_SYNC))) { int timeout = 50; ipu_cm_write(ipu, IPUIRQ_2_MASK(IPU_IRQ_BG_SYNC_EOF), @@ -2198,16 +2198,18 @@ int32_t ipu_disable_channel(struct ipu_soc *ipu, ipu_channel_t channel, bool wai irq = in_dma; if (irq == 0xffffffff) { - dev_err(ipu->dev, "warning: no channel busy, break\n"); + dev_dbg(ipu->dev, "warning: no channel busy, break\n"); break; } - dev_err(ipu->dev, "warning: channel %d busy, need wait\n", irq); - ipu_cm_write(ipu, IPUIRQ_2_MASK(irq), IPUIRQ_2_STATREG(irq)); - while ((ipu_cm_read(ipu, IPUIRQ_2_STATREG(irq)) & - IPUIRQ_2_MASK(irq)) == 0) { + + dev_dbg(ipu->dev, "warning: channel %d busy, need wait\n", irq); + + while (((ipu_cm_read(ipu, IPUIRQ_2_STATREG(irq)) + & IPUIRQ_2_MASK(irq)) == 0) && + (idma_is_set(ipu, IDMAC_CHA_BUSY, irq))) { msleep(10); timeout -= 10; if (timeout <= 0) { diff --git a/drivers/mxc/ipu3/ipu_disp.c b/drivers/mxc/ipu3/ipu_disp.c index 25d17ca5862b..498a329b0990 100644 --- a/drivers/mxc/ipu3/ipu_disp.c +++ b/drivers/mxc/ipu3/ipu_disp.c @@ -935,14 +935,16 @@ void _ipu_dp_dc_disable(struct ipu_soc *ipu, ipu_channel_t channel, bool swap) reg = ipu_cm_read(ipu, IPU_SRM_PRI2) | 0x8; ipu_cm_write(ipu, reg, IPU_SRM_PRI2); - ipu_cm_write(ipu, IPUIRQ_2_MASK(IPU_IRQ_DP_SF_END), - IPUIRQ_2_STATREG(IPU_IRQ_DP_SF_END)); - while ((ipu_cm_read(ipu, IPUIRQ_2_STATREG(IPU_IRQ_DP_SF_END)) & - IPUIRQ_2_MASK(IPU_IRQ_DP_SF_END)) == 0) { - msleep(2); - timeout -= 2; - if (timeout <= 0) - break; + if (ipu_is_channel_busy(ipu, MEM_BG_SYNC)) { + ipu_cm_write(ipu, IPUIRQ_2_MASK(IPU_IRQ_DP_SF_END), + IPUIRQ_2_STATREG(IPU_IRQ_DP_SF_END)); + while ((ipu_cm_read(ipu, IPUIRQ_2_STATREG(IPU_IRQ_DP_SF_END)) & + IPUIRQ_2_MASK(IPU_IRQ_DP_SF_END)) == 0) { + msleep(2); + timeout -= 2; + if (timeout <= 0) + break; + } } return; } else { |