From: Inki Dae Date: Fri, 12 Jun 2015 13:19:22 +0000 (+0900) Subject: drm/exynos: fimd: fix page fault issue with iommu X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=94ab95a94c1f8a5e7ff3930010a2afaba1448e9d;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git drm/exynos: fimd: fix page fault issue with iommu This patch resolves page fault issue with iommu and atomic feature when modetest test application is terminated. ENWIN_F field of WINCONx register enables or disable a dma channel to each hardware overlay - the value of the field will be updated to real register after vsync. So this patch makes sure the dma channel is disabled by waiting for vsync one time after clearing shadow registers to all dma channels. Below shows the page fault issue: setting mode 720x1280-60Hz@XR24 on connectors 31, crtc 29 freq: 59.99Hz [ 34.831025] PAGE FAULT occurred at 0x20400000 by 11e20000.sysmmu(Page table base: 0x6e324000) [ 34.838072] Lv1 entry: 0x6e92dc01 [ 34.841489] ------------[ cut here ]------------ [ 34.846058] kernel BUG at drivers/iommu/exynos-iommu.c:364! [ 34.851614] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP ARM [ 34.857428] Modules linked in: <--snip--> [ 35.210894] [] (exynos_sysmmu_irq) from [] (handle_irq_event_percpu+0x78/0x134) [ 35.219914] [] (handle_irq_event_percpu) from [] (handle_irq_event+0x3c/0x5c) [ 35.228768] [] (handle_irq_event) from [] (handle_level_irq+0xc4/0x13c) [ 35.237101] [] (handle_level_irq) from [] (generic_handle_irq+0x2c/0x3c) [ 35.245521] [] (generic_handle_irq) from [] (combiner_handle_cascade_irq+0x94/0x100) [ 35.254980] [] (combiner_handle_cascade_irq) from [] (generic_handle_irq+0x2c/0x3c) [ 35.264353] [] (generic_handle_irq) from [] (__handle_domain_irq+0x7c/0xec) [ 35.273034] [] (__handle_domain_irq) from [] (gic_handle_irq+0x30/0x68) [ 35.281366] [] (gic_handle_irq) from [] (__irq_svc+0x40/0x74) Signed-off-by: Inki Dae --- diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c index b5bd16ceaa96..1e3bb72184d2 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c @@ -820,6 +820,10 @@ static void fimd_disable(struct exynos_drm_crtc *crtc) for (i = 0; i < WINDOWS_NR; i++) fimd_win_disable(crtc, i); + fimd_enable_vblank(crtc); + fimd_wait_for_vblank(crtc); + fimd_disable_vblank(crtc); + writel(0, ctx->regs + VIDCON0); clk_disable_unprepare(ctx->lcd_clk);