From patchwork Wed May 30 12:15:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maciej Purski X-Patchwork-Id: 10438819 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8CC12601E9 for ; Wed, 30 May 2018 12:17:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5A4B728ABF for ; Wed, 30 May 2018 12:17:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 562FF28A52; Wed, 30 May 2018 12:17:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8006128C6B for ; Wed, 30 May 2018 12:16:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752667AbeE3MQf (ORCPT ); Wed, 30 May 2018 08:16:35 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:34126 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751689AbeE3MQ2 (ORCPT ); Wed, 30 May 2018 08:16:28 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20180530121626euoutp021fa672beea95199f574cc0b6a83d4856~zazffu8cv0118901189euoutp02c; Wed, 30 May 2018 12:16:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20180530121626euoutp021fa672beea95199f574cc0b6a83d4856~zazffu8cv0118901189euoutp02c DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1527682586; bh=02sS8uJr1lgT090FZGvwIJFzQQP9r9REvcBQ8o26geM=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=OzT1Gd69sknUxg+MXQvc6cN/xen8NK1JdLdSvem8b2UsxUVVIgNUyKLwQh6ovEiNH 0+5No4rs2PyWnubrUCsVIQ6zElfuzOmYy+egv5xPpTdIIgmdojaMcde5cZ/Jl4eYKw JGlGRHLr417YNC5K1/FbkIahgy9GA2/ppSphXp+Q= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180530121624eucas1p13710179022d7dd0ed410da3edd506753~zazePtZux2956529565eucas1p1d; Wed, 30 May 2018 12:16:24 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 08.2D.17380.8169E0B5; Wed, 30 May 2018 13:16:24 +0100 (BST) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180530121623eucas1p1309b2c054ccd7a52a611b46346709af9~zazdDaGY12711927119eucas1p1G; Wed, 30 May 2018 12:16:23 +0000 (GMT) X-AuditID: cbfec7f4-b4fc79c0000043e4-73-5b0e9618c1c0 Received: from eusync1.samsung.com ( [203.254.199.211]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 40.0A.04178.7169E0B5; Wed, 30 May 2018 13:16:23 +0100 (BST) Received: from AMDC2075.DIGITAL.local ([106.120.51.25]) by eusync1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0P9J00FMPJF35I90@eusync1.samsung.com>; Wed, 30 May 2018 13:16:23 +0100 (BST) From: Maciej Purski To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org Cc: David Airlie , Rob Herring , Mark Rutland , Thierry Reding , Kukjin Kim , Krzysztof Kozlowski , Archit Taneja , Andrzej Hajda , Laurent Pinchart , Inki Dae , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , Marek Szyprowski , Bartlomiej Zolnierkiewicz , Maciej Purski Subject: [PATCH v2 02/10] drm/exynos: move pm_runtime_get_sync() to exynos_dsi_init() Date: Wed, 30 May 2018 14:15:53 +0200 Message-id: <1527682561-1386-3-git-send-email-m.purski@samsung.com> X-Mailer: git-send-email 2.7.4 In-reply-to: <1527682561-1386-1-git-send-email-m.purski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAAzWSa0hTYRjHe892Lg5nh2n4qiG0EsvQLPrwQmZSEgci8puimB7zeKFtyo5T F5RLXG3eL5iXQvdBxWzezWqolK3EJM1mTgXTkiRv5DA1ozLn9Nvv+T//58LDQwkkObgnlaxI 45QKViYlRMLut1vD/vCBS1Tg/CdPNNUyjKOC4UEMZetWcNRe2YqjWvOONrb+g0ClM8VC9P3z qBAVzS0J0MhIG4neZy+TSF9SR6KOuXEcWUyPCFQ50ochw8KUEDWbp0lUbx3FkLbXTKLKsgUC bZlqhCGHGGONETCWwgKMeVE9TTIPdVU409GkJ5hnG7M4M5M3gDGddVlMYVcTYNY6vMNEkaKg eE6WnM4pTwXHipI23hiJ1PWDma0rM6QGtIhzgRMF6bOwsbQN2FlCNwJYMJOQC0Q7vAagccJE 7pvKv37BHIkGALVPbQJHsA3g3W4tngsoiqD9oPF+jF13o5sA7JxYAfZAQJfj8EPtEm5v5UqH w7WpdszOQtoHVvWVAHuxmL4EV62sY5o3nBzWC+yyEx0Kn/QE29tAuoyE45p1wuEJhe9e5uMO doWLA117mx6Get0rzMEpUDs/t6dnwr6CoT3/Ofh6YHSXBbQLLO2u2J0FaTHU3ZM4LAy0bW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FeZv DnNkMO9ol/+ROUlDx3BX4/P/biZrp+abqirzvuFl3yST1bFjqejDBtYqZr5ltdPXrvtd+nQq 58a2ZO13/+wuXlv4L36mxuTNQvtj2F4HhWfveavEUpyRaKjFXFScCAD3vPPIdwIAAA== X-CMS-MailID: 20180530121623eucas1p1309b2c054ccd7a52a611b46346709af9 X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180530121623eucas1p1309b2c054ccd7a52a611b46346709af9 References: <1527682561-1386-1-git-send-email-m.purski@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In order to allow bridge drivers to use DSI transfers in their pre_enable callbacks, pm_runtime_get_sync() should be performed before exynos_dsi_enable(). DSIM_STATE_ENABLED flag now should not guard from calling dsi_host_transfer() before enabling. Signed-off-by: Maciej Purski --- drivers/gpu/drm/exynos/exynos_drm_dsi.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index 9599e6b..85eb2262 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -1312,6 +1312,7 @@ static int exynos_dsi_init(struct exynos_dsi *dsi) { const struct exynos_dsi_driver_data *driver_data = dsi->driver_data; + pm_runtime_get_sync(dsi->dev); exynos_dsi_reset(dsi); exynos_dsi_enable_irq(dsi); @@ -1388,7 +1389,6 @@ static void exynos_dsi_enable(struct drm_encoder *encoder) ret = drm_panel_prepare(dsi->panel); if (ret < 0) { dsi->state &= ~DSIM_STATE_ENABLED; - pm_runtime_put_sync(dsi->dev); return; } @@ -1400,7 +1400,6 @@ static void exynos_dsi_enable(struct drm_encoder *encoder) dsi->state &= ~DSIM_STATE_ENABLED; exynos_dsi_set_display_enable(dsi, false); drm_panel_unprepare(dsi->panel); - pm_runtime_put_sync(dsi->dev); return; } @@ -1422,7 +1421,10 @@ static void exynos_dsi_disable(struct drm_encoder *encoder) dsi->state &= ~DSIM_STATE_ENABLED; - pm_runtime_put_sync(dsi->dev); + if (dsi->state & DSIM_STATE_INITIALIZED) { + pm_runtime_put_sync(dsi->dev); + dsi->state &= ~DSIM_STATE_INITIALIZED; + } } static enum drm_connector_status @@ -1566,9 +1568,6 @@ static ssize_t exynos_dsi_host_transfer(struct mipi_dsi_host *host, struct exynos_dsi_transfer xfer; int ret; - if (!(dsi->state & DSIM_STATE_ENABLED)) - return -EINVAL; - if (!(dsi->state & DSIM_STATE_INITIALIZED)) { ret = exynos_dsi_init(dsi); if (ret)