From patchwork Tue Apr 15 05:47:31 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: YoungJun Cho X-Patchwork-Id: 3989001 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 6A4AB9F464 for ; Tue, 15 Apr 2014 05:48:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 939E820221 for ; Tue, 15 Apr 2014 05:48:04 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id A8B2B200C6 for ; Tue, 15 Apr 2014 05:48:03 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6760F6E346; Mon, 14 Apr 2014 22:47:59 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout1.samsung.com (mailout1.samsung.com [203.254.224.24]) by gabe.freedesktop.org (Postfix) with ESMTP id 2D4F06E17C for ; Mon, 14 Apr 2014 22:47:54 -0700 (PDT) Received: from epcpsbgr5.samsung.com (u145.gpu120.samsung.co.kr [203.254.230.145]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N42008W75FQ5960@mailout1.samsung.com> for dri-devel@lists.freedesktop.org; Tue, 15 Apr 2014 14:47:50 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [203.254.230.41]) by epcpsbgr5.samsung.com (EPCPMTA) with SMTP id 07.CC.14803.508CC435; Tue, 15 Apr 2014 14:47:49 +0900 (KST) X-AuditID: cbfee691-b7efc6d0000039d3-be-534cc8058c96 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 7F.DC.28157.508CC435; Tue, 15 Apr 2014 14:47:49 +0900 (KST) Received: from localhost.localdomain ([10.252.75.90]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0N4200KNL5FIU632@mmp1.samsung.com>; Tue, 15 Apr 2014 14:47:49 +0900 (KST) From: YoungJun Cho To: airlied@linux.ie, dri-devel@lists.freedesktop.org Subject: [RFC PATCH 03/14] drm/exynos: use wait_event_timeout() for safety usage Date: Tue, 15 Apr 2014 14:47:31 +0900 Message-id: <1397540862-21359-4-git-send-email-yj44.cho@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1397540862-21359-1-git-send-email-yj44.cho@samsung.com> References: <1397540862-21359-1-git-send-email-yj44.cho@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrOIsWRmVeSWpSXmKPExsVy+t8zTV3WEz7BBqdX21jcWneO1aL33Ekm i/lHgKwrX9+zWfS/Wchqce7VSkaLSfcnsFi8uHeRxaJ3wVU2i7NNb9gtZpzfx2Sx9PpFJosJ 09eyWLTuPQIUm/ySzeLnrnksDgIea+atYfS43NfL5LFz1l12j5XLv7B5bFrVyeax/dsDVo/7 3ceZPPq2rGL0+LxJLoAzissmJTUnsyy1SN8ugSvj3N0XLAU7OSuaXvQyNzC2c3QxcnJICJhI zFq6lQnCFpO4cG89WxcjF4eQwDJGiclrlrHAFM2efhEqsYhR4t7H/4wQTiuTxMu/V9lAqtgE NCWef9zBCmKLCJhKdExaygJSxCzwhEmi61o/2A5hgQCJV1cug9ksAqoSz27vZAexeQVcJBr+ HwUaxAG0TkFiziQbkDCngKvE1e0LWEDCQkAli5cVgoyUEPjLLtE38T4rxBgBiW+TD7FAtMpK bDrADHG0pMTBFTdYJjAKL2BkWMUomlqQXFCclF5kqlecmFtcmpeul5yfu4kREmkTdzDeP2B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v23vGmAsS7no3K1xXP/+umB39WzTtedD2 rDo1n0jntdplnybdzqz7/dSodf3ZKfKNhatsHtrH9iT/vbNAaeLp34zH5HsDzs10rd32rmqt 8Dzh6BnNuh87xJ5ef+46Z2uunc6Su4HnDW8pNx6bMifS4NBypSXKHjO5g3xv+F7Sl1ViKc5I NNRiLipOBADUjBBMJwMAAA== 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, sw0312.kim@samsung.com, a.hajda@samsung.com, kyungmin.park@samsung.com, robh+dt@kernel.org, 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=-5.2 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 Signed-off-by: Inki Dae Signed-off-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); }