From patchwork Wed Aug 31 12:55:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 75092 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp321635qga; Wed, 31 Aug 2016 05:56:42 -0700 (PDT) X-Received: by 10.66.161.132 with SMTP id xs4mr16564195pab.140.1472648190277; Wed, 31 Aug 2016 05:56:30 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 202si50797815pfx.121.2016.08.31.05.56.30; Wed, 31 Aug 2016 05:56:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-media-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-media-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-media-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934324AbcHaM4Y (ORCPT + 4 others); Wed, 31 Aug 2016 08:56:24 -0400 Received: from mailout4.w1.samsung.com ([210.118.77.14]:15387 "EHLO mailout4.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934236AbcHaM4X (ORCPT ); Wed, 31 Aug 2016 08:56:23 -0400 Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout4.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OCR002JHYLP4Q00@mailout4.w1.samsung.com>; Wed, 31 Aug 2016 13:56:13 +0100 (BST) X-AuditID: cbfec7f5-f792e6d0000013f5-d8-57c6d3ed9b97 Received: from eusync1.samsung.com ( [203.254.199.211]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id B4.5E.05109.DE3D6C75; Wed, 31 Aug 2016 13:56:13 +0100 (BST) 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 <0OCR00GIKYLJHR40@eusync1.samsung.com>; Wed, 31 Aug 2016 13:56:13 +0100 (BST) From: Marek Szyprowski To: dri-devel@lists.freedesktop.org, linux-media@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Inki Dae , Joonyoung Shim , Seung-Woo Kim , Andrzej Hajda , Sylwester Nawrocki , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz Subject: [PATCH 2/6] drm/exynos: gsc: fix system and runtime pm integration Date: Wed, 31 Aug 2016 14:55:55 +0200 Message-id: <1472648159-9814-3-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1472648159-9814-1-git-send-email-m.szyprowski@samsung.com> References: <1472648159-9814-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprHLMWRmVeSWpSXmKPExsVy+t/xy7pvLx8LN3jZzW9xa905VouNM9az Wlz5+p7NYtL9CSwWL+5dZLF4/cLQomfDVlaLGef3MVmsPXKX3eLwm3Ygd/JLNgduj/vdx5k8 +rasYvT4vEkugDmKyyYlNSezLLVI3y6BK+N880vGgpM8Fed+H2RvYLzI1cXIySEhYCKxbdl6 FghbTOLCvfVsXYxcHEICSxklHi9oYYRwmpgkZrc/YQapYhMwlOh628UGYosIpEp0r13PBFLE LPCYSeLNqvnsIAlhAW+JVf+3gRWxCKhKNM8/C7aCV8BdYs6h64wQ6+QkTh6bzApicwp4SKye 9RbMFgKqWfvwPOsERt4FjAyrGEVTS5MLipPSc430ihNzi0vz0vWS83M3MUJC7esOxqXHrA4x CnAwKvHwHph1NFyINbGsuDL3EKMEB7OSCK/YxWPhQrwpiZVVqUX58UWlOanFhxilOViUxHln 7nofIiSQnliSmp2aWpBaBJNl4uCUamBsmu9v7Gew43xzacCW2bE1zKs6/oplBd08rcAxRftw 5NcdN6UrJH66HV7+T1ovKnyR9J7+/0z2R0WlgmednZXI/m/ltlvqEvOnViudeHhha77S1pQy 77X7OD+v+mLxbuu8WROabXI5ayLuJl5Y+JZvPuPHLX0u7NnK8RN0u+ymz5P3u2zi9j9JiaU4 I9FQi7moOBEAkB+kBTECAAA= Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Use generic helpers instead of open-coding usage of runtime pm for system sleep pm, which was potentially broken for some corner cases. Signed-off-by: Marek Szyprowski --- drivers/gpu/drm/exynos/exynos_drm_gsc.c | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/gpu/drm/exynos/exynos_drm_gsc.c b/drivers/gpu/drm/exynos/exynos_drm_gsc.c index 5d20da8f957e..b1894aa9286e 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gsc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gsc.c @@ -1760,32 +1760,6 @@ static int gsc_remove(struct platform_device *pdev) return 0; } -#ifdef CONFIG_PM_SLEEP -static int gsc_suspend(struct device *dev) -{ - struct gsc_context *ctx = get_gsc_context(dev); - - DRM_DEBUG_KMS("id[%d]\n", ctx->id); - - if (pm_runtime_suspended(dev)) - return 0; - - return gsc_clk_ctrl(ctx, false); -} - -static int gsc_resume(struct device *dev) -{ - struct gsc_context *ctx = get_gsc_context(dev); - - DRM_DEBUG_KMS("id[%d]\n", ctx->id); - - if (!pm_runtime_suspended(dev)) - return gsc_clk_ctrl(ctx, true); - - return 0; -} -#endif - #ifdef CONFIG_PM static int gsc_runtime_suspend(struct device *dev) { @@ -1807,7 +1781,8 @@ static int gsc_runtime_resume(struct device *dev) #endif static const struct dev_pm_ops gsc_pm_ops = { - SET_SYSTEM_SLEEP_PM_OPS(gsc_suspend, gsc_resume) + SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, + pm_runtime_force_resume) SET_RUNTIME_PM_OPS(gsc_runtime_suspend, gsc_runtime_resume, NULL) };