From patchwork Thu Jul 9 14:28:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Hajda X-Patchwork-Id: 6756581 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 125969F9E0 for ; Thu, 9 Jul 2015 14:28:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 11B632073A for ; Thu, 9 Jul 2015 14:28:33 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 042B920715 for ; Thu, 9 Jul 2015 14:28:32 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6FE6A6E663; Thu, 9 Jul 2015 07:28:30 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4FAD16E0E2 for ; Thu, 9 Jul 2015 07:28:25 -0700 (PDT) Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout1.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NR800ETU5JB3G70@mailout1.w1.samsung.com> for dri-devel@lists.freedesktop.org; Thu, 09 Jul 2015 15:28:23 +0100 (BST) X-AuditID: cbfec7f4-f79c56d0000012ee-c6-559e850748a8 Received: from eusync4.samsung.com ( [203.254.199.214]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id 4F.E3.04846.7058E955; Thu, 9 Jul 2015 15:28:23 +0100 (BST) Received: from AMDC1061.digital.local ([106.116.147.88]) by eusync4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0NR800ITO5J33710@eusync4.samsung.com>; Thu, 09 Jul 2015 15:28:22 +0100 (BST) From: Andrzej Hajda To: Inki Dae Subject: [PATCH 3/7] drm/exynos/hdmi: remove private lock code Date: Thu, 09 Jul 2015 16:28:08 +0200 Message-id: <1436452092-20757-4-git-send-email-a.hajda@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1436452092-20757-1-git-send-email-a.hajda@samsung.com> References: <1436452092-20757-1-git-send-email-a.hajda@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupmluLIzCtJLcpLzFFi42I5/e/4NV321nmhBjO3MlncWneO1WLjjPWs Fle+vmezmHR/AovFi3sXWSxmnN/HZLH2yF12B3aP+93HmTz6tqxi9Pi8SS6AOYrLJiU1J7Ms tUjfLoEr49XUTsaCJ+IVO5ofsjQw3hfuYuTkkBAwkVjfvYEJwhaTuHBvPVsXIxeHkMBSRond 67qZIJwmJonv35+ygVSxCWhK/N18E8wWEVCWWLWvnR2kiFmggUmi//17sFHCAnYSd5vXsYLY LAKqEqdWTgCzeQWcJX5sO8kIsU5O4uSxyWBxTgEXie1trWC9QkA1+54+YJzAyLuAkWEVo2hq aXJBcVJ6rqFecWJucWleul5yfu4mRkgQfdnBuPiY1SFGAQ5GJR7exp1zQ4VYE8uKK3MPMUpw MCuJ8J5vnhcqxJuSWFmVWpQfX1Sak1p8iFGag0VJnHfurvchQgLpiSWp2ampBalFMFkmDk6p Bsbli1d1N9i3T1ur187Kc3WaUiOnPt/0FykJOrI5Ybx6O35rS0+w41E2Ma/xD3if+M1546mP MT8P7a67zxLXE8u+qmjfHYODwWvlGP7cUNq04I2HzL/d5ZbiRzVkT4TOOrVmVfv04x+DpDcX yP+dobjmgYdrxdYl7y6e2L9bsqc1KzDkkVofX5cSS3FGoqEWc1FxIgBmFcVTHgIAAA== Cc: linux-samsung-soc@vger.kernel.org, Bartlomiej Zolnierkiewicz , dri-devel@lists.freedesktop.org, Andrzej Hajda , Marek Szyprowski X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 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.5 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 Most of the code is called by drm core framework, so it is already synchronized. The only async function is irq routine which only calls drm framework so it does not need to be synchronized. Signed-off-by: Andrzej Hajda --- drivers/gpu/drm/exynos/exynos_hdmi.c | 27 +++------------------------ 1 file changed, 3 insertions(+), 24 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c index 1d07bdf..f2e909d 100644 --- a/drivers/gpu/drm/exynos/exynos_hdmi.c +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c @@ -22,7 +22,6 @@ #include "regs-hdmi.h" #include -#include #include #include #include @@ -188,7 +187,6 @@ struct hdmi_context { struct drm_encoder *encoder; bool powered; bool dvi_mode; - struct mutex hdmi_mutex; void __iomem *regs; int irq; @@ -1774,10 +1772,8 @@ static void hdmi_conf_apply(struct hdmi_context *hdata) hdmiphy_conf_reset(hdata); hdmiphy_conf_apply(hdata); - mutex_lock(&hdata->hdmi_mutex); hdmi_start(hdata, false); hdmi_conf_init(hdata); - mutex_unlock(&hdata->hdmi_mutex); hdmi_audio_init(hdata); @@ -2029,12 +2025,8 @@ static void hdmi_commit(struct exynos_drm_display *display) { struct hdmi_context *hdata = display_to_hdmi(display); - mutex_lock(&hdata->hdmi_mutex); - if (!hdata->powered) { - mutex_unlock(&hdata->hdmi_mutex); + if (!hdata->powered) return; - } - mutex_unlock(&hdata->hdmi_mutex); hdmi_conf_apply(hdata); } @@ -2043,16 +2035,11 @@ static void hdmi_poweron(struct hdmi_context *hdata) { struct hdmi_resources *res = &hdata->res; - mutex_lock(&hdata->hdmi_mutex); - if (hdata->powered) { - mutex_unlock(&hdata->hdmi_mutex); + if (hdata->powered) return; - } hdata->powered = true; - mutex_unlock(&hdata->hdmi_mutex); - pm_runtime_get_sync(hdata->dev); if (regulator_bulk_enable(res->regul_count, res->regul_bulk)) @@ -2073,10 +2060,8 @@ static void hdmi_poweroff(struct hdmi_context *hdata) { struct hdmi_resources *res = &hdata->res; - mutex_lock(&hdata->hdmi_mutex); if (!hdata->powered) - goto out; - mutex_unlock(&hdata->hdmi_mutex); + return; /* HDMI System Disable */ hdmi_reg_writemask(hdata, HDMI_CON_0, 0, HDMI_EN); @@ -2096,11 +2081,7 @@ static void hdmi_poweroff(struct hdmi_context *hdata) pm_runtime_put_sync(hdata->dev); - mutex_lock(&hdata->hdmi_mutex); hdata->powered = false; - -out: - mutex_unlock(&hdata->hdmi_mutex); } static void hdmi_dpms(struct exynos_drm_display *display, int mode) @@ -2330,8 +2311,6 @@ static int hdmi_probe(struct platform_device *pdev) hdata->display.type = EXYNOS_DISPLAY_TYPE_HDMI; hdata->display.ops = &hdmi_display_ops; - mutex_init(&hdata->hdmi_mutex); - platform_set_drvdata(pdev, hdata); match = of_match_node(hdmi_match_types, dev->of_node);