From patchwork Wed May 7 07:46:23 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: YoungJun Cho X-Patchwork-Id: 4125921 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 62F37BFF02 for ; Wed, 7 May 2014 07:46:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 750CE2035C for ; Wed, 7 May 2014 07:46:50 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 9FA59202FF for ; Wed, 7 May 2014 07:46:49 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B0DEC6EC48; Wed, 7 May 2014 00:46:46 -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 7D9056EC45 for ; Wed, 7 May 2014 00:46:45 -0700 (PDT) Received: from epcpsbgr2.samsung.com (u142.gpu120.samsung.co.kr [203.254.230.142]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N5700G541LV52D0@mailout2.samsung.com> for dri-devel@lists.freedesktop.org; Wed, 07 May 2014 16:46:43 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [203.254.230.43]) by epcpsbgr2.samsung.com (EPCPMTA) with SMTP id EA.52.14563.3E4E9635; Wed, 07 May 2014 16:46:43 +0900 (KST) X-AuditID: cbfee68e-b7fd86d0000038e3-42-5369e4e32153 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id C6.26.27725.2E4E9635; Wed, 07 May 2014 16:46:43 +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 <0N5700FKJ1LRTV30@mmp2.samsung.com>; Wed, 07 May 2014 16:46:42 +0900 (KST) From: YoungJun Cho To: airlied@linux.ie, dri-devel@lists.freedesktop.org Subject: [RFC v4 PATCH 02/18] drm/exynos: use wait_event_timeout() for safety usage Date: Wed, 07 May 2014 16:46:23 +0900 Message-id: <1399448799-8057-3-git-send-email-yj44.cho@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1399448799-8057-1-git-send-email-yj44.cho@samsung.com> References: <1399448799-8057-1-git-send-email-yj44.cho@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrFIsWRmVeSWpSXmKPExsVy+t8zbd3HTzKDDQ7O4bK4te4cq0XvuZNM FvOPAFlXvr5ns+h/s5DV4tyrlYwWk+5PYLF4ce8ii0XvgqtsFmeb3rBbdE5cwm4x4/w+Joul 1y8yWUyYvpbFonXvEXaLTx8XsljMmPySzeLnrnksDkIea+atYfS43NfL5LFz1l12j5XLv7B5 zO6YyeqxaVUnm8f2bw9YPe53H2fy6P9r4NG3ZRWjx+dNcgHcUVw2Kak5mWWpRfp2CVwZrfdv MhWs56zY8uwVYwPjX/YuRk4OCQETiVNHXrBA2GISF+6tZ+ti5OIQEljGKNG2eQErTFHv+1ns EInpjBILmk8yQzitTBKtB74wg1SxCWhKPP+4A6xDRMBUomPSUhaQImaBJcwS+2c/ANsnLBAq 0Xb7AFMXIwcHi4CqRO8PLZAwr4CzxMvWrywgYQkBBYk5k2xAwpwCLhIvPnxkBLGFgEourjkJ NlJCYC6HxL2Db8B2sQgISHybfAiqV1Zi0wFmiKMlJQ6uuMEygVF4ASPDKkbR1ILkguKk9CIj veLE3OLS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jE3NiYNGElcd4DrdaBQgLpiSWp2ampBalFMFuYODilGhi1lk7TaeKQ yXr132rLW/1VTgWc7vwPdli+2OcnIM/Yy7ls7WK7re8Pmdzh8d0l69bzzkRYMWaRcdcMmfAH TvXFdk75rZUfDmlJvJs8M9Lb86rAunSvuZbnS8vvNy6szjkcsvWR+fycp+vS7lnxPhJ/XiOp 92YCi8dKwaDjc3d9/3a7LMkhYLoSS3FGoqEWc1FxIgASsN5WOgMAAA== 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, s.trumtrar@pengutronix.de 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); }