Commit a14e14ba authored by Ming Qian's avatar Ming Qian Committed by Mauro Carvalho Chehab

media: imx-jpeg: Clear slot next desc ptr if config error

clear slot next desc ptr if config error,
otherwise codec will report config error interrupt repeatedly,
it may led to system hang.
Signed-off-by: default avatarMing Qian <ming.qian@nxp.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent 492b99c2
...@@ -178,3 +178,8 @@ void mxc_jpeg_set_desc(u32 desc, void __iomem *reg, int slot) ...@@ -178,3 +178,8 @@ void mxc_jpeg_set_desc(u32 desc, void __iomem *reg, int slot)
writel(desc | MXC_NXT_DESCPT_EN, writel(desc | MXC_NXT_DESCPT_EN,
reg + MXC_SLOT_OFFSET(slot, SLOT_NXT_DESCPT_PTR)); reg + MXC_SLOT_OFFSET(slot, SLOT_NXT_DESCPT_PTR));
} }
void mxc_jpeg_clr_desc(void __iomem *reg, int slot)
{
writel(0, reg + MXC_SLOT_OFFSET(slot, SLOT_NXT_DESCPT_PTR));
}
...@@ -137,6 +137,7 @@ void mxc_jpeg_set_bufsize(struct mxc_jpeg_desc *desc, u32 bufsize); ...@@ -137,6 +137,7 @@ void mxc_jpeg_set_bufsize(struct mxc_jpeg_desc *desc, u32 bufsize);
void mxc_jpeg_set_res(struct mxc_jpeg_desc *desc, u16 w, u16 h); void mxc_jpeg_set_res(struct mxc_jpeg_desc *desc, u16 w, u16 h);
void mxc_jpeg_set_line_pitch(struct mxc_jpeg_desc *desc, u32 line_pitch); void mxc_jpeg_set_line_pitch(struct mxc_jpeg_desc *desc, u32 line_pitch);
void mxc_jpeg_set_desc(u32 desc, void __iomem *reg, int slot); void mxc_jpeg_set_desc(u32 desc, void __iomem *reg, int slot);
void mxc_jpeg_clr_desc(void __iomem *reg, int slot);
void mxc_jpeg_set_regs_from_desc(struct mxc_jpeg_desc *desc, void mxc_jpeg_set_regs_from_desc(struct mxc_jpeg_desc *desc,
void __iomem *reg); void __iomem *reg);
#endif #endif
...@@ -696,6 +696,7 @@ static irqreturn_t mxc_jpeg_dec_irq(int irq, void *priv) ...@@ -696,6 +696,7 @@ static irqreturn_t mxc_jpeg_dec_irq(int irq, void *priv)
u32 ret = readl(reg + CAST_STATUS12); u32 ret = readl(reg + CAST_STATUS12);
dev_err(dev, "Encoder/decoder error, status=0x%08x", ret); dev_err(dev, "Encoder/decoder error, status=0x%08x", ret);
mxc_jpeg_clr_desc(reg, slot);
mxc_jpeg_sw_reset(reg); mxc_jpeg_sw_reset(reg);
buf_state = VB2_BUF_STATE_ERROR; buf_state = VB2_BUF_STATE_ERROR;
goto buffers_done; goto buffers_done;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment