diff options
author | Mirela Rabulea <mirela.rabulea@nxp.com> | 2018-11-22 16:22:28 +0200 |
---|---|---|
committer | Jason Liu <jason.hui.liu@nxp.com> | 2019-02-12 10:35:30 +0800 |
commit | 50e605cdd21155dcd655aecef24d852187ed781f (patch) | |
tree | 22a4674026aeb44fc698356ae8a21ea867fe2761 /drivers/media/platform/imx8 | |
parent | b6276a16a80976479c4f46500ad1f89b5137da7d (diff) |
MLK-19942: mxc-jpeg: Workaround for "Instance released before end of transaction"
The context is released after FRM_DONE interrupt is received,
but for some small images, after FRM_DONE, a HALF_BUF interrupt
keeps coming, and cannot be cleared.
A soft reset helps (resets only the decoder internal state, not registers).
Signed-off-by: Mirela Rabulea <mirela.rabulea@nxp.com>
Diffstat (limited to 'drivers/media/platform/imx8')
-rw-r--r-- | drivers/media/platform/imx8/mxc-jpeg.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/media/platform/imx8/mxc-jpeg.c b/drivers/media/platform/imx8/mxc-jpeg.c index 8746f41f0c13..cece57840aaf 100644 --- a/drivers/media/platform/imx8/mxc-jpeg.c +++ b/drivers/media/platform/imx8/mxc-jpeg.c @@ -418,10 +418,18 @@ static irqreturn_t mxc_jpeg_dec_irq(int irq, void *priv) spin_lock(&jpeg->hw_lock); + dec_ret = readl(reg + MXC_SLOT_OFFSET(slot, SLOT_STATUS)); + writel(dec_ret, reg + MXC_SLOT_OFFSET(slot, SLOT_STATUS)); /* w1c */ + ctx = v4l2_m2m_get_curr_priv(jpeg->m2m_dev); if (!ctx) { dev_err(dev, - "Instance released before the end of transaction.\n"); + "Instance released before the end of transaction 0x%x.", + dec_ret); + /* soft reset only resets internal state, not registers */ + mxc_jpeg_sw_reset(reg); + /* clear all interrupts */ + writel(0xFFFFFFFF, reg + MXC_SLOT_OFFSET(slot, SLOT_STATUS)); goto job_unlock; } @@ -435,9 +443,6 @@ static irqreturn_t mxc_jpeg_dec_irq(int irq, void *priv) goto buffers_done; } - dec_ret = readl(reg + MXC_SLOT_OFFSET(slot, SLOT_STATUS)); - writel(dec_ret, reg + MXC_SLOT_OFFSET(slot, SLOT_STATUS)); /* w1c */ - if (dec_ret & SLOTa_STATUS_ENC_CONFIG_ERR) { u32 ret = readl(reg + CAST_STATUS12); |