From patchwork Fri Jun 12 13:35:17 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inki Dae X-Patchwork-Id: 6598811 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id BB891C0020 for ; Fri, 12 Jun 2015 13:35:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CC90720686 for ; Fri, 12 Jun 2015 13:35:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A393420681 for ; Fri, 12 Jun 2015 13:35:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753338AbbFLNfV (ORCPT ); Fri, 12 Jun 2015 09:35:21 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:54985 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752818AbbFLNfU (ORCPT ); Fri, 12 Jun 2015 09:35:20 -0400 Received: from epcpsbgr3.samsung.com (u143.gpu120.samsung.co.kr [203.254.230.143]) by mailout3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NPU02WD532USE80@mailout3.samsung.com> for linux-samsung-soc@vger.kernel.org; Fri, 12 Jun 2015 22:35:18 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.115]) by epcpsbgr3.samsung.com (EPCPMTA) with SMTP id E4.B3.24422.610EA755; Fri, 12 Jun 2015 22:35:18 +0900 (KST) X-AuditID: cbfee68f-f793b6d000005f66-9e-557ae0160479 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id E2.19.25346.610EA755; Fri, 12 Jun 2015 22:35:18 +0900 (KST) Received: from daeinki-desktop.10.32.193.11 ([10.252.83.67]) by mmp1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0NPU0081T32UD530@mmp1.samsung.com>; Fri, 12 Jun 2015 22:35:18 +0900 (KST) From: Inki Dae To: dri-devel@lists.freedesktop.org Cc: airlied@linux.ie, linux-samsung-soc@vger.kernel.org, Inki Dae Subject: [PATCH] drm/exynos: fimd: fix page fault issue with iommu Date: Fri, 12 Jun 2015 22:35:17 +0900 Message-id: <1434116117-8897-1-git-send-email-inki.dae@samsung.com> X-Mailer: git-send-email 1.7.9.5 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrHLMWRmVeSWpSXmKPExsWyRsSkWFfsQVWowYE/Wha9504yWVz5+p7N YtL9CSwWM87vY3Jg8dj+7QGrx/3u40wefVtWMXp83iQXwBLFZZOSmpNZllqkb5fAlbF37y7m guvCFX++PWVrYLwn0MXIySEhYCLxfdYLFghbTOLCvfVsXYxcHEICSxkl1t5vYYUp2nWgnQnE FhJYxCgx6aQgRFEDk8Tl811gCTYBVYmJK+6zgdgiAsoSfyeuYgSxmQWiJJYfXsoOYgsLOEk0 bmkBs1mA6s/uOwDWyyvgLPHi21Wgeg6gZQoScybZgMyXELjPJvFj+WuoegGJb5MPsUDUyEps OsAMcZukxMEVN1gmMAouYGRYxSiaWpBcUJyUXmSsV5yYW1yal66XnJ+7iREYjKf/PevfwXj3 gPUhRgEORiUe3gStqlAh1sSy4srcQ4ymQBsmMkuJJucDQz6vJN7Q2MzIwtTE1NjI3NJMSZx3 odTPYCGB9MSS1OzU1ILUovii0pzU4kOMTBycUg2MmxLWKszfoyFxODLlbXziiRWfZ0bq8t/w uLPmbOnHWzv27O55Pn+agJC6NMP+8h8HJDJ/96/VqJmyYZs//x7ja9udjHXef2518/m0kWXH pBl/7l14kL71X61+SaLB7sq/Qc9FfSu/+f/l6Iu4e/5DkGNN+Z2elKDK3I/xUw6f9uL/UGs0 YVveDiWW4oxEQy3mouJEANle+MFBAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrBLMWRmVeSWpSXmKPExsVy+t9jAV2xB1WhBlt/q1r0njvJZHHl63s2 i0n3J7BYzDi/j8mBxWP7twesHve7jzN59G1ZxejxeZNcAEtUA6NNRmpiSmqRQmpecn5KZl66 rZJ3cLxzvKmZgaGuoaWFuZJCXmJuqq2Si0+ArltmDtBOJYWyxJxSoFBAYnGxkr4dpgmhIW66 FjCNEbq+IUFwPUYGaCBhDWPG3r27mAuuC1f8+faUrYHxnkAXIyeHhICJxK4D7UwQtpjEhXvr 2UBsIYFFjBKTTgp2MXIB2Q1MEpfPd4EVsQmoSkxccR+sSERAWeLvxFWMIDazQJTE8sNL2UFs YQEnicYtLWA2C1D92X0HwHp5BZwlXny7ClTPAbRMQWLOJJsJjNwLGBlWMYqmFiQXFCel5xrq FSfmFpfmpesl5+duYgSH+jOpHYwrGywOMQpwMCrx8D70rwoVYk0sK67MPcQowcGsJMLLfAMo xJuSWFmVWpQfX1Sak1p8iNEUaPlEZinR5HxgHOaVxBsam5gZWRqZG1oYGZsrifOezPcJFRJI TyxJzU5NLUgtgulj4uCUamCs/ZbzviJ95mmWBebxMv3prQLLk2SniYkY//i9NdbhUs7zw0eZ OVc389W8uqhmaLDa7Pu636fP+2nUWFyQnnHyZTrTTOk4hhzzNYUx3pUZTpnnlP5r5F3MmvB1 MoP2qwI5XrbqgKl3OFdN3Oi0UiL1t9+Rb14NFm/nNP4yXmS6f4bi7t9HgliUWIozEg21mIuK EwFNqKvGiwIAAA== DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- drivers/gpu/drm/exynos/exynos_drm_fimd.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c index fda62da..4bac303 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c @@ -813,6 +813,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);