drm/rockchip: vop: fix iommu crash when resume
authorMark Yao <mark.yao@rock-chips.com>
Thu, 19 Jan 2017 06:19:00 +0000 (14:19 +0800)
committerHuang, Tao <huangtao@rock-chips.com>
Thu, 19 Jan 2017 06:58:51 +0000 (14:58 +0800)
commit396818f4664a98200569144f760edbd468f4f0c0
treef495998cd05f553d135e9befa608ed8f230b4aa0
parent0eea41f3e20be40f03fce2b8a792fcca4d12a24b
drm/rockchip: vop: fix iommu crash when resume

Iommu crash with that path:
   vop_disable:
      1, disable all windows and set vop config done
      2, vop enter to standy, all windows not works, but their registers
         are not clean, when you read window's enable bit, may found the
         window is enable.

   vop_enable:
      1, memcpy(vop->regsbak, vop->regs, len)
         save current vop registers to vop->regsbak, then you can found
         window is enable on regsbak.
      2, VOP_WIN_SET(vop, win, gate, 1);
         force enable window gate, but gate and enable is on same
         hardware register, the means window enable rewrite to vop hardware.
   then:
      when some on do vop_config_done but not reconfigure the bad
      register window, iommu crash.

Do register configure before memcpy(vop->regsbak, vop->regs, len) is not
safe, after that would be save.

Change-Id: I55b7846b1d39901c6b357fe541c9af1729b2c6b9
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
drivers/gpu/drm/rockchip/rockchip_drm_vop.c