]> git.baikalelectronics.ru Git - kernel.git/commit
drm/rockchip: vop: fix iommu page fault when resume
authorMark yao <mark.yao@rock-chips.com>
Mon, 31 Jul 2017 09:49:42 +0000 (17:49 +0800)
committerMark Yao <mark.yao@rock-chips.com>
Fri, 4 Aug 2017 08:09:37 +0000 (16:09 +0800)
commitf08ee0ca8ae7da15aa2c1b6be54d5a4823395245
tree64b266fcc4753b6924971af9888c9afa8e797e9a
parent85e915e029042e02d4894056f1363667c3f827d0
drm/rockchip: vop: fix iommu page fault when resume

Iommu would get page fault with following 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 are on same
         hardware register, then window enable bit rewrite to vop hardware.
      3, vop power on, and vop might try to scan destroyed buffer,
         then iommu get page fault.

Move windows disable after vop regsbak restore, then vop regsbak mechanism
would keep tracing the modify, everything would be safe.

Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
Reviewed-by: Sandy huang <sandy.huang@rock-chips.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1501494582-6934-1-git-send-email-mark.yao@rock-chips.com
drivers/gpu/drm/rockchip/rockchip_drm_vop.c