From patchwork Fri Mar 1 12:20:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Hajda X-Patchwork-Id: 10835097 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8B69E922 for ; Fri, 1 Mar 2019 12:21:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 799AB2097A for ; Fri, 1 Mar 2019 12:21:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6DBC72D8F5; Fri, 1 Mar 2019 12:21:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0ABAF2D900 for ; Fri, 1 Mar 2019 12:21:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388221AbfCAMVS (ORCPT ); Fri, 1 Mar 2019 07:21:18 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:36640 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388213AbfCAMVQ (ORCPT ); Fri, 1 Mar 2019 07:21:16 -0500 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20190301122115euoutp019581fa78f4a07b8bbea448dcea9f85e9~H1RMysiGK1452714527euoutp01U; Fri, 1 Mar 2019 12:21:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20190301122115euoutp019581fa78f4a07b8bbea448dcea9f85e9~H1RMysiGK1452714527euoutp01U DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1551442875; bh=cpYT42EusnvUENfsBe2CbH4a+nZgA0tdO6X2xO+kOvw=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=qD0cpXdniLeugHQ60ckxP07ojB5k0N/lXyafW0oh1pMI47PLsP9PeVtHmUm4KdzjB hzq2t96YezIwnr2bz+mAx4jHCaxfdUpe1jybFYJce5W2k8N4gPr2RnycC1kBxah/jl DejFl+R3BivZvLf2Ntklx2sP2iPbGUsYqmQ4sR0M= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20190301122114eucas1p2fd609d15a0ad6d3fd24ed5e02e5bc461~H1RMVZQn62981229812eucas1p2e; Fri, 1 Mar 2019 12:21:14 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 5E.CC.04294.AB3297C5; Fri, 1 Mar 2019 12:21:14 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20190301122113eucas1p25f441847f19e4d1a355bffd7633dcd5d~H1RLjV9iL2978429784eucas1p2x; Fri, 1 Mar 2019 12:21:13 +0000 (GMT) X-AuditID: cbfec7f4-84fff700000010c6-16-5c7923ba58b9 Received: from eusync3.samsung.com ( [203.254.199.213]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 2B.23.04284.9B3297C5; Fri, 1 Mar 2019 12:21:13 +0000 (GMT) Received: from AMDC3748.DIGITAL.local ([106.120.43.17]) by eusync3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0PNO007ENSZ56Z20@eusync3.samsung.com>; Fri, 01 Mar 2019 12:21:13 +0000 (GMT) From: Andrzej Hajda To: Inki Dae Cc: Andrzej Hajda , Bartlomiej Zolnierkiewicz , Marek Szyprowski , dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org Subject: [PATCH 21/23] drm/exynos/decon5433: wait for finish previous update Date: Fri, 01 Mar 2019 13:20:53 +0100 Message-id: <20190301122055.7135-22-a.hajda@samsung.com> X-Mailer: git-send-email 2.17.1 In-reply-to: <20190301122055.7135-1-a.hajda@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupjkeLIzCtJLcpLzFFi42LZduzned1dypUxBqdOC1ncWneO1WLjjPWs Fle+vmezmHR/AovFjPP7mCzWHrnL7sDmcb/7OJNH35ZVjB6fN8kFMEdx2aSk5mSWpRbp2yVw Zexdupi9oEug4tiOf0wNjB95uxg5OSQETCQ+7v7F1sXIxSEksIJRYtn2uewgCSGBz4wSs6Z6 whRN37WMHaJoGaPEmg87mCCc/4wSj5e8YgWpYhPQlPi7+SYbiC0ioCyxal87WAezwCVGidcn uxlBEsICPhJTLxwHs1kEVCXeXZsH1MDBwStgITH3oS3ENnmJ1RsOMIPYnEDhgysh5kgIvGWV ON5zjwWiyEViyq2dzBC2jERnx0EmCLteomnmFWaIhg5GiROLl7NBJKwlDh+/CHYpswCfxKRt 05lBFksI8Ep0tAlBlHhIHD3WDvVZN9DRE1+yTmCUWMDIsIpRPLW0ODc9tdgoL7Vcrzgxt7g0 L10vOT93EyMwlk7/O/5lB+OuP0mHGAU4GJV4eBNelscIsSaWFVfmHmKU4GBWEuHlY6iMEeJN SaysSi3Kjy8qzUktPsQozcGiJM5bzfAgWkggPbEkNTs1tSC1CCbLxMEp1cCYZ9GdGXupcM4k DXGur10FAgvnt53TcCiYPonx6BP3kymTT5svjbl+Iq7xtqPntqNvUtbvMm1LaTLXEAuV/ynI 6tV8l/tI5MT2+9N8xLk6FqpU5n1K23T+BdOxs5rfnYJ6T3AGv68K7tlY8zSZ2/H4lX7un1Xz 4wsCEtxvCbe4q/W1vW+enafEUpyRaKjFXFScCAA2eJKCoQIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrOJMWRmVeSWpSXmKPExsVy+t/xq7o7lStjDPoO6VjcWneO1WLjjPWs Fle+vmezmHR/AovFjPP7mCzWHrnL7sDmcb/7OJNH35ZVjB6fN8kFMEdx2aSk5mSWpRbp2yVw Zexdupi9oEug4tiOf0wNjB95uxg5OSQETCSm71rG3sXIxSEksIRR4tyKiUwQTiOTxLzuhewg VWwCmhJ/N99kA7FFBJQlVu1rB+tgFrjCKNH+rQusSFjAR2LqheOMIDaLgKrEu2vzgBo4OHgF LCTmPrSF2CYvsXrDAWYQmxMofHAlyBwOoGXmEptOR01g5FnAyLCKUSS1tDg3PbfYUK84Mbe4 NC9dLzk/dxMjMDi2Hfu5eQfjpY3BhxgFOBiVeHgTXpbHCLEmlhVX5h5ilOBgVhLh5WOojBHi TUmsrEotyo8vKs1JLT7EKM3BoiTOe96gMkpIID2xJDU7NbUgtQgmy8TBKdXA2Ns+6XODYOd0 zaMOU+4a6ju/Mfh/YlLLno+Rb2VUZAOuzEt8O21jZmfCpUc1GnMS1i0v1GhzdmI8G7vzt1Iw X9qE6wf7O98KvE49Gb6nOXvZjESvdcp1epv5551fqOI247B/b3p4R9QnXcllDbP9mL2ltnis uzJJJ+mXJWPwrPTN4jEO339lKrEUZyQaajEXFScCAMe2e/gKAgAA X-CMS-MailID: 20190301122113eucas1p25f441847f19e4d1a355bffd7633dcd5d CMS-TYPE: 201P X-CMS-RootMailID: 20190301122113eucas1p25f441847f19e4d1a355bffd7633dcd5d References: <20190301122055.7135-1-a.hajda@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP DECON should wait for previous update before starting new one. Otherwise internal registers can be updated in non-atomic, error prone way. This patch fixes occasional occurrences of vblank timeouts on tm2 platform: [ 3167.968742] [CRTC:55:crtc-0] vblank wait timed out [ 3167.987440] WARNING: CPU: 1 PID: 194 at ../drivers/gpu/drm/drm_atomic_helper.c:1423 drm_atomic_helper_wait_for_vblanks.part.9+0x2c0/0x2c8 [ 3168.029990] Modules linked in: [ 3168.047240] CPU: 1 PID: 194 Comm: modetest Tainted: G W 5.0.0-rc1+ #694 [ 3168.069539] Hardware name: Samsung TM2 board (DT) ... [ 3168.453566] Call trace: [ 3168.469705] drm_atomic_helper_wait_for_vblanks.part.9+0x2c0/0x2c8 [ 3168.489983] drm_atomic_helper_commit_tail_rpm+0x60/0x78 [ 3168.509463] commit_tail+0x44/0x78 [ 3168.527053] drm_atomic_helper_commit+0xe8/0x160 [ 3168.546010] drm_atomic_commit+0x48/0x58 [ 3168.564304] drm_atomic_helper_update_plane+0x11c/0x140 [ 3168.584080] __setplane_atomic+0x130/0x150 [ 3168.602799] setplane_internal+0xb0/0x1a8 [ 3168.621493] drm_mode_setplane+0xc4/0x1b8 [ 3168.640219] drm_ioctl_kernel+0x94/0x110 [ 3168.658920] drm_ioctl+0x1c8/0x428 ... Signed-off-by: Andrzej Hajda --- drivers/gpu/drm/exynos/exynos5433_drm_decon.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c index b0332763594e..09f035f52444 100644 --- a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c +++ b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c @@ -406,6 +406,11 @@ static void decon_set_gscl_mode(struct decon_context *ctx) static void decon_atomic_begin(struct exynos_drm_crtc *crtc) { struct decon_context *ctx = to_decon(crtc); + u32 val; + + /* wait for finish previous updates */ + if (readl_poll_timeout(ctx->addr + DECON_UPDATE, val, !val, 1000, 20000) < 0) + dev_err(ctx->dev, "DECON_UPDATE timeout\n"); decon_shadow_protect(ctx, true); decon_set_gscl_mode(ctx);