From patchwork Mon Feb 26 14:43:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 10242491 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 544F660208 for ; Mon, 26 Feb 2018 14:43:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 42FFA29D67 for ; Mon, 26 Feb 2018 14:43:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 356572A073; Mon, 26 Feb 2018 14:43:52 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, 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 4115729D67 for ; Mon, 26 Feb 2018 14:43:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753766AbeBZOnu (ORCPT ); Mon, 26 Feb 2018 09:43:50 -0500 Received: from mailout2.w1.samsung.com ([210.118.77.12]:45791 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753719AbeBZOnt (ORCPT ); Mon, 26 Feb 2018 09:43:49 -0500 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20180226144347euoutp02c6c089c81ee600a06e18f9db543d4ec3~W50mRjoWC0781407814euoutp021; Mon, 26 Feb 2018 14:43:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20180226144347euoutp02c6c089c81ee600a06e18f9db543d4ec3~W50mRjoWC0781407814euoutp021 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1519656227; bh=C1TtCIJvoxuq2vqV9D2G7V44wbPJPTlUfvb9UovyCOc=; h=From:To:Cc:Subject:Date:References:From; b=XOnvOdSKHlkR5gEGcmtPPx6ydIpRuFr54yFjAA2eujA2gcss2rDH1AjE/b+L1n3NG aq+MFGwbWe+AJEaWqv6mVRq4Jbudq9YQzPndIbZlHJLXtJiB2Lb1iKehhUvu5nqcI/ TOClKSnLXkzr9ZBgmVvcJ0qYMgzdQV+K60pE2Ev4= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180226144346eucas1p1a0cda43a905d3e42c4d30fabc2da9cf5~W50lWtqec2080920809eucas1p1t; Mon, 26 Feb 2018 14:43:46 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 10.67.05700.12D149A5; Mon, 26 Feb 2018 14:43:45 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180226144345eucas1p177661aa4eacd6a282192c7e28e6872c4~W50kT4FEW1036810368eucas1p1n; Mon, 26 Feb 2018 14:43:45 +0000 (GMT) X-AuditID: cbfec7f2-1dbff70000011644-a1-5a941d21533f Received: from eusync1.samsung.com ( [203.254.199.211]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 3D.2B.04178.12D149A5; Mon, 26 Feb 2018 14:43:45 +0000 (GMT) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0P4R00B6PI8U6HC0@eusync1.samsung.com>; Mon, 26 Feb 2018 14:43:45 +0000 (GMT) From: Marek Szyprowski To: dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Archit Taneja , Yakir Yang , Sean Paul , Bartlomiej Zolnierkiewicz , Laurent Pinchart , Andrzej Hajda Subject: [PATCH v2] drm/bridge: analogix_dp: Keep PHY powered between driver bind/unbind Date: Mon, 26 Feb 2018 15:43:40 +0100 Message-id: <20180226144340.24608-1-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.15.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrPIsWRmVeSWpSXmKPExsWy7djP87qKslOiDL5dtra4te4cq0VTx1tW i40z1rNaXPn6ns2ic+ISdosZ5/cxWaw9cpfd4u6Gs4wW5xomsztwesxuuMjicbmvl8ljdsdM Vo/73ceZPP7O2s/i0bdlFaPH501yAexRXDYpqTmZZalF+nYJXBl3H51mKmgTrJg0ZS5jA+Na vi5GTg4JAROJdWenMncxcnEICaxglGjbO5UdwvnMKPH48FpGmKotJ88wQSSWMUrMXbecFcJp YJJ4dv0vO0gVm4ChRNfbLjYQW0TATaLp8EywImaBLUwSj3duBisSFoiS+PPuNFgRi4CqxI77 jWAreAVsJZ50TIZaJy+x+PtONpBmCYEONokVyz8zQSRcJH5s+cYCYQtLvDq+hR3ClpHo7DjI BNHQzyjx7/9LKGcGo8T6j61QVdYSh49fZAWxmQX4JCZtmw70NwdQnFeio00IosRD4l/XCagr HCUO3VsN1iokECvx5MMf9gmMkgsYGVYxiqeWFuempxYb5qWW6xUn5haX5qXrJefnbmIERuvp f8c/7WD8einpEKMAB6MSD++Cn5OihFgTy4orcw8xSnAwK4nwrlw8OUqINyWxsiq1KD++qDQn tfgQozQHi5I4b5xGXZSQQHpiSWp2ampBahFMlomDU6qBMV7VPtbfoMT/b0ZYf3B5nzbjURe1 46vZjsSmm4a7XCzOvPE5cuap1ylGUSGLNLzfx8/krH6TlF1f6xZSJqJ17OjH91+mOHW90lXk 8d+5yuZRaQZHznXhpJbTf3ZfOXf7gyr35VX6ZyssAlVz5yl/nl8VX6H2oGmK513nH+sns1/b vT3xoGCZEktxRqKhFnNRcSIApax2x9ICAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmphluLIzCtJLcpLzFFi42I5/e/4ZV1F2SlRBu92ClncWneO1aKp4y2r xcYZ61ktrnx9z2bROXEJu8WM8/uYLNYeuctucXfDWUaLcw2T2R04PWY3XGTxuNzXy+Qxu2Mm q8f97uNMHn9n7Wfx6NuyitHj8ya5APYoLpuU1JzMstQifbsEroy7j04zFbQJVkyaMpexgXEt XxcjJ4eEgInElpNnmLoYuTiEBJYwSvSfe8YC4TQxSXzb/5IRpIpNwFCi620XG4gtIuAm0XR4 JitIEbPANiaJE7/mgCWEBaIk/rw7DWazCKhK7LjfCNbMK2Ar8aRjMiPEOnmJxd93sk1g5FrA yLCKUSS1tDg3PbfYUK84Mbe4NC9dLzk/dxMjMGy2Hfu5eQfjpY3BhxgFOBiVeHgX/JwUJcSa WFZcmXuIUYKDWUmEd+XiyVFCvCmJlVWpRfnxRaU5qcWHGKU5WJTEec8bVEYJCaQnlqRmp6YW pBbBZJk4OKUaGBlW2GYHbhGysblwfhFbxpdthy/kCmpU9x8/Oj3Y2GZj9bfeFZvNvxmI/c36 5CVqbee5adumsqOHjNLac2TZPn2ZaeltpMcwYV15Q0ROYOjdsq7MkMa3W+Z+KJ5madp2wG5f bkLDwcd71Kpz9sz/9XvDrjOSVixqQu/vHGhXaw9b5iNdk/pqhRJLcUaioRZzUXEiALc5eHgX AgAA X-CMS-MailID: 20180226144345eucas1p177661aa4eacd6a282192c7e28e6872c4 X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180226144345eucas1p177661aa4eacd6a282192c7e28e6872c4 X-RootMTR: 20180226144345eucas1p177661aa4eacd6a282192c7e28e6872c4 References: 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 Patch f0a8b49c03d2 ("drm/bridge: analogix dp: Fix runtime PM state on driver bind") fixed unbalanced call to phy_power_on() in analogix_dp_bind() function by calling phy_power_off() at the end of bind operation. However it turned out that having PHY powered is required for proper DRM display pipeline initialization on Peach-Pit Chromebook2 board, as this board freezes otherwise when PHY power off is called in bind. Fix this by keeping PHY powered for the whole bind/unbind driver life cycle. The freeze is probably related to the fact that the display pipeline (Exynos FIMD CTRC -> Exynos/Analogix DP bridge -> PS8625 dp2lvds bridge -> B116XW03 panel) is already configured and enabled by the bootloader and requires reset of all components for proper shutdown. Having PHY powered is also needed for proper EDID handling, which has been fixed by commit 510353a63796 ("drm/bridge: analogix dp: Fix runtime PM state in get_modes() callback"). Fixes: f0a8b49c03d2 ("drm/bridge: analogix dp: Fix runtime PM state on driver bind") Signed-off-by: Marek Szyprowski --- Changelog: v2: - added comment in the code about Chromebook2 Peach-PIT issue --- drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c index a8905049b9da..5b6c04c44f01 100644 --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c @@ -1419,8 +1419,11 @@ int analogix_dp_bind(struct device *dev, struct drm_device *drm_dev, goto err_disable_pm_runtime; } - phy_power_off(dp->phy); pm_runtime_put(dev); + /* + * intentionally keep PHY powered on, Chromebook2 Peach-PIT board + * freezes otherwise + */ return 0; @@ -1452,6 +1455,7 @@ void analogix_dp_unbind(struct device *dev, struct device *master, drm_dp_aux_unregister(&dp->aux); pm_runtime_disable(dev); + phy_power_off(dp->phy); clk_disable_unprepare(dp->clock); } EXPORT_SYMBOL_GPL(analogix_dp_unbind);