From: Herman Chen Date: Mon, 29 Aug 2016 10:04:44 +0000 (+0800) Subject: rockchip/vcodec: fix crash on decoder buffer empty X-Git-Tag: firefly_0821_release~1647 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=d16a8c722057ce403f0a28f6aaee205d8a25ea71;p=firefly-linux-kernel-4.4.55.git rockchip/vcodec: fix crash on decoder buffer empty 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 --- diff --git a/drivers/video/rockchip/vcodec/vcodec_service.c b/drivers/video/rockchip/vcodec/vcodec_service.c index 536ad1e05937..d9cf0c6caf98 100644 --- a/drivers/video/rockchip/vcodec/vcodec_service.c +++ b/drivers/video/rockchip/vcodec/vcodec_service.c @@ -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);