From patchwork Sun Apr 27 01:49:58 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: YoungJun Cho X-Patchwork-Id: 4069901 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 7B37ABFF02 for ; Sun, 27 Apr 2014 01:50:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 50E802025A for ; Sun, 27 Apr 2014 01:50:23 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id EC81420270 for ; Sun, 27 Apr 2014 01:50:20 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B15E36E3D4; Sat, 26 Apr 2014 18:50:18 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout3.samsung.com (mailout3.samsung.com [203.254.224.33]) by gabe.freedesktop.org (Postfix) with ESMTP id 9EF296E32A for ; Sat, 26 Apr 2014 18:50:17 -0700 (PDT) Received: from epcpsbgr1.samsung.com (u141.gpu120.samsung.co.kr [203.254.230.141]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N4O00EO72FRBE60@mailout3.samsung.com> for dri-devel@lists.freedesktop.org; Sun, 27 Apr 2014 10:50:15 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [203.254.230.45]) by epcpsbgr1.samsung.com (EPCPMTA) with SMTP id 12.D5.18501.7526C535; Sun, 27 Apr 2014 10:50:15 +0900 (KST) X-AuditID: cbfee68d-b7f4e6d000004845-1d-535c62573ccf Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id CE.F1.27725.7526C535; Sun, 27 Apr 2014 10:50:15 +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 <0N4O008HN2FOD450@mmp1.samsung.com>; Sun, 27 Apr 2014 10:50:15 +0900 (KST) From: YoungJun Cho To: airlied@linux.ie, dri-devel@lists.freedesktop.org Subject: [RFC v3 PATCH 02/16] drm/exynos: use wait_event_timeout() for safety usage Date: Sun, 27 Apr 2014 10:49:58 +0900 Message-id: <1398563412-21781-3-git-send-email-yj44.cho@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1398563412-21781-1-git-send-email-yj44.cho@samsung.com> References: <1398563412-21781-1-git-send-email-yj44.cho@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrEIsWRmVeSWpSXmKPExsVy+t8zXd3wpJhggwOftC1urTvHatF77iST xfwjQNaVr+/ZLPrfLGS1OPdqJaPFpPsTWCxe3LvIYtG74CqbxdmmN+wWnROXsFvMOL+PyWLp 9YtMFhOmr2WxaN17BCg2+SWbxc9d81gcBD3WzFvD6HG5r5fJY+esu+weK5d/YfOY3TGT1WPT qk42j+3fHrB63O8+zuTRt2UVo8fnTXIBXFFcNimpOZllqUX6dglcGa33bzIVrOes2PLsFWMD 41/2LkZODgkBE4ktR65B2WISF+6tZ+ti5OIQEljGKLHnRQsbTNHUPa1QiUWMEituPmWCcFqZ JNpaVrOAVLEJaEo8/7iDFcQWETCV6Ji0lAWkiFmgk1niy/25TCAJYYFQieu728H2sQioSmxe MREszivgIvFy0T+gZg6gdQoScybZgIQ5BVwlTi9ZywxiCwGV3D/4lxVkpoRAJ4fE/EmtbBBz BCS+TT7EAtErK7HpADPE1ZISB1fcYJnAKLyAkWEVo2hqQXJBcVJ6kaFecWJucWleul5yfu4m Rkj89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s1tSC1CGYLEwenVAPjJX77K+vOvbRZc/YMm5ul7Zynq67H bK69xzxvSqn8/UrHMzvalWMzptkdL2spnFLR/db/2+7zsv0+h32ZuhexNn3KUCh1F7g1U2GF pUzc0ZkFccscV20K4xfY7hDneiraWJqZ94Ucb9U1iQ9ru08q9RULr338JE8pZt29MPWvrNIn gva/6uNXYinOSDTUYi4qTgQA96DR9TIDAAA= 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, 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); }