From d05c5b242b5a316ae92f3d8e44e062dc299b7ef7 Mon Sep 17 00:00:00 2001 From: Mark Yao Date: Mon, 7 Nov 2016 14:22:36 +0800 Subject: [PATCH] video: rockchip: rk322x: keep vop standby before enable iommu Vop may access illegal address and cause bus error with: 1, vop iommu is disable 2, vop is enable and its window use a iommu mapping address The illegal memory access may cause bus abnormal. Change-Id: I17d52ae12140b9bf85d37123765f7163422ec8f5 Signed-off-by: Mark Yao --- drivers/video/rockchip/lcdc/rk322x_lcdc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/video/rockchip/lcdc/rk322x_lcdc.c b/drivers/video/rockchip/lcdc/rk322x_lcdc.c index bcdfc0fcdd97..26c49a36bf82 100644 --- a/drivers/video/rockchip/lcdc/rk322x_lcdc.c +++ b/drivers/video/rockchip/lcdc/rk322x_lcdc.c @@ -3561,7 +3561,6 @@ static int vop_early_resume(struct rk_lcdc_driver *dev_drv) spin_lock(&vop_dev->reg_lock); vop_msk_reg(vop_dev, DSP_CTRL0, V_DSP_OUT_ZERO(0)); - vop_msk_reg(vop_dev, SYS_CTRL, V_VOP_STANDBY_EN(0)); vop_msk_reg(vop_dev, DSP_CTRL0, V_DSP_BLANK_EN(0)); vop_cfg_done(vop_dev); spin_unlock(&vop_dev->reg_lock); @@ -3574,6 +3573,11 @@ static int vop_early_resume(struct rk_lcdc_driver *dev_drv) rockchip_iovmm_activate(dev_drv->dev); } + spin_lock(&vop_dev->reg_lock); + vop_msk_reg(vop_dev, SYS_CTRL, V_VOP_STANDBY_EN(0)); + vop_cfg_done(vop_dev); + spin_unlock(&vop_dev->reg_lock); + dev_drv->suspend_flag = 0; if (dev_drv->trsm_ops && dev_drv->trsm_ops->enable) -- 2.34.1