From patchwork Mon Apr 21 12:28:30 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: YoungJun Cho X-Patchwork-Id: 4024241 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 8DF209F319 for ; Mon, 21 Apr 2014 12:29:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C2BAA203A9 for ; Mon, 21 Apr 2014 12:29:00 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id EC9EC2021F for ; Mon, 21 Apr 2014 12:28:59 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E77CF6E6DC; Mon, 21 Apr 2014 05:28:57 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout2.samsung.com (mailout2.samsung.com [203.254.224.25]) by gabe.freedesktop.org (Postfix) with ESMTP id 2217A6E5CE for ; Mon, 21 Apr 2014 05:28:46 -0700 (PDT) Received: from epcpsbgr3.samsung.com (u143.gpu120.samsung.co.kr [203.254.230.143]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N4D00D89RZWDD30@mailout2.samsung.com> for dri-devel@lists.freedesktop.org; Mon, 21 Apr 2014 21:28:45 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [203.254.230.45]) by epcpsbgr3.samsung.com (EPCPMTA) with SMTP id A9.D5.11120.CFE05535; Mon, 21 Apr 2014 21:28:44 +0900 (KST) X-AuditID: cbfee68f-b7eff6d000002b70-0a-53550efc835a Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 6E.A3.27725.CFE05535; Mon, 21 Apr 2014 21:28:44 +0900 (KST) Received: from localhost.localdomain ([10.252.75.90]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0N4D000WURZT7I00@mmp2.samsung.com>; Mon, 21 Apr 2014 21:28:44 +0900 (KST) From: YoungJun Cho To: airlied@linux.ie, dri-devel@lists.freedesktop.org Subject: [RFC v2 PATCH 03/14] drm/exynos: use wait_event_timeout() for safety usage Date: Mon, 21 Apr 2014 21:28:30 +0900 Message-id: <1398083321-8668-4-git-send-email-yj44.cho@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1398083321-8668-1-git-send-email-yj44.cho@samsung.com> References: <1398083321-8668-1-git-send-email-yj44.cho@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrNIsWRmVeSWpSXmKPExsVy+t8zXd0/fKHBBk0nTCxurTvHatF77iST xfwjQNaVr+/ZLPrfLGS1OPdqJaPFpPsTWCxe3LvIYtG74CqbxdmmN+wWnROXsFvMOL+PyWLp 9YtMFhOmr2WxaN17hN3i5J9eRosZk1+yWfzcNY/FQchjzbw1jB6X+3qZPHbOusvusXL5FzaP 2R0zWT02repk87hzbQ+bx/ZvD1g97ncfZ/Lo27KK0ePzJrkA7igum5TUnMyy1CJ9uwSujNb7 N5kK1nNWbHn2irGB8S97FyMnh4SAicTUzhtMELaYxIV769m6GLk4hASWMUrMmT+TBaboxP7T zBCJ6YwS12ffgXJamSTm/trKDFLFJqAp8fzjDlYQW0TAVKJj0lKwbmaBRcwSi+8YgdjCAqES a/+9B4uzCKhKrLkxkw3E5hVwlvg17T2QzQG0TUFiziQbkDCngIvE7ulLwEYKAZV8af7MCLJX QmAmh8T2vTfZIeYISHybfIgFoldWYtMBZoijJSUOrrjBMoFReAEjwypG0dSC5ILipPQiY73i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RX Em9obGJmZGlkZmxibmxMmrCSOO+BVutAIYH0xJLU7NTUgtQimC1MHJxSDYxnN35fblViy+HL G8+969ysc06cU799k0owcvHd95Z/V8bSdBfPLP3kq6KrLx+pyH4oV/fyr/3iGsaIXf/sj3W8 escVLtdYYisXYLDqiZewzse+lWuuC3felnS4rDEx75r6pZ97BN/lfr8zeYlTjzWP6bO9KQd7 QmYJ3rg5T+iQ+daUh2cl4tYpsRRnJBpqMRcVJwIA6l1ARzsDAAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Cc: mark.rutland@arm.com, devicetree@vger.kernel.org, linux-samsung-soc@vger.kernel.org, pawel.moll@arm.com, ijc+devicetree@hellion.org.uk, sachin.kamat@linaro.org, sw0312.kim@samsung.com, a.hajda@samsung.com, kyungmin.park@samsung.com, robh+dt@kernel.org, laurent.pinchart@ideasonboard.com, galak@codeaurora.org, kgene.kim@samsung.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 There could be the case that the page flip operation isn't finished correctly with some abnormal condition such as panel reset. So this patch replaces wait_event() with wait_event_timeout() to avoid waiting for page flip completion infinitely. Signed-off-by: YoungJun Cho Acked-by: Inki Dae Acked-by: Kyungmin Park --- drivers/gpu/drm/exynos/exynos_drm_crtc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_crtc.c b/drivers/gpu/drm/exynos/exynos_drm_crtc.c index e930d4f..1419d11 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_crtc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_crtc.c @@ -69,8 +69,9 @@ static void exynos_drm_crtc_dpms(struct drm_crtc *crtc, int mode) if (mode > DRM_MODE_DPMS_ON) { /* wait for the completion of page flip. */ - wait_event(exynos_crtc->pending_flip_queue, - atomic_read(&exynos_crtc->pending_flip) == 0); + wait_event_timeout(exynos_crtc->pending_flip_queue, + !atomic_read(&exynos_crtc->pending_flip), + HZ/20); drm_vblank_off(crtc->dev, exynos_crtc->pipe); }