From: Mark Yao Date: Mon, 7 Nov 2016 06:22:36 +0000 (+0800) Subject: video: rockchip: rk322x: keep vop standby before enable iommu X-Git-Tag: firefly_0821_release~1298 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=d05c5b242b5a316ae92f3d8e44e062dc299b7ef7;p=firefly-linux-kernel-4.4.55.git 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 --- 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)