rockchip/vcodec: fix crash on decoder buffer empty
authorHerman Chen <herman.chen@rock-chips.com>
Mon, 29 Aug 2016 10:04:44 +0000 (18:04 +0800)
committerHuang, Tao <huangtao@rock-chips.com>
Mon, 29 Aug 2016 11:46:26 +0000 (19:46 +0800)
On vpu2 register separate interrupt bit and enable bit to different
register. When decoder found a buffer empty error which means the input
stream is not enough for one complete frame decoder will not stop
reading input stream buffer until it reach the end of buffer. This will
cause mmu fault on the buffer end.

In order to avoid this case decoder need to clear the enable bit in the
enable register to stop decoder from reading.

Change-Id: I6133aa4611fab03f6545b4775e8ee2320552445f
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
drivers/video/rockchip/vcodec/vcodec_service.c

index 536ad1e05937a4810dfde992bacead2d34c2c92f..d9cf0c6caf987ba57ee7939634feec2d30a62021 100644 (file)
@@ -2745,7 +2745,7 @@ static irqreturn_t vdpu_irq(int irq, void *dev_id)
                        writel(0x100000, dev->regs + task->reg_irq);
 
                /* set clock gating to save power */
-               writel(task->gating_mask, dev->regs + task->reg_irq);
+               writel(task->gating_mask, dev->regs + task->reg_en);
 
                atomic_add(1, &dev->irq_count_codec);
                time_diff(task);