All of lore.kernel.org
 help / color / mirror / Atom feed
From: Inki Dae <inki.dae@samsung.com>
To: Gustavo Padovan <gustavo@padovan.org>
Cc: linux-samsung-soc@vger.kernel.org,
	dri-devel@lists.freedesktop.org, jy0922.shim@samsung.com,
	tjakobi@math.uni-bielefeld.de,
	Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Subject: Re: [PATCH v2] drm/exynos: add error messages if clks failed to get enabled
Date: Thu, 11 Jun 2015 23:12:10 +0900	[thread overview]
Message-ID: <5579973A.8010900@samsung.com> (raw)
In-Reply-To: <1433362636-10975-1-git-send-email-gustavo@padovan.org>

On 2015년 06월 04일 05:17, Gustavo Padovan wrote:
> From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
> 
> Check error and call DRM_ERROR if clk_prepare_enable() fails.

Applied.

Thanks,
Inki Dae

> 
> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
> ---
>  drivers/gpu/drm/exynos/exynos7_drm_decon.c | 28 +++++++++++++++++++++++----
>  drivers/gpu/drm/exynos/exynos_drm_fimd.c   | 14 ++++++++++++--
>  drivers/gpu/drm/exynos/exynos_mixer.c      | 31 +++++++++++++++++++++++++-----
>  3 files changed, 62 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/gpu/drm/exynos/exynos7_drm_decon.c b/drivers/gpu/drm/exynos/exynos7_drm_decon.c
> index d659ba2..d9798e2 100644
> --- a/drivers/gpu/drm/exynos/exynos7_drm_decon.c
> +++ b/drivers/gpu/drm/exynos/exynos7_drm_decon.c
> @@ -606,6 +606,7 @@ static void decon_init(struct decon_context *ctx)
>  static void decon_enable(struct exynos_drm_crtc *crtc)
>  {
>  	struct decon_context *ctx = crtc->ctx;
> +	int ret;
>  
>  	if (!ctx->suspended)
>  		return;
> @@ -614,10 +615,29 @@ static void decon_enable(struct exynos_drm_crtc *crtc)
>  
>  	pm_runtime_get_sync(ctx->dev);
>  
> -	clk_prepare_enable(ctx->pclk);
> -	clk_prepare_enable(ctx->aclk);
> -	clk_prepare_enable(ctx->eclk);
> -	clk_prepare_enable(ctx->vclk);
> +	ret = clk_prepare_enable(ctx->pclk);
> +	if (ret < 0) {
> +		DRM_ERROR("Failed to prepare_enable the pclk [%d]\n", ret);
> +		return;
> +	}
> +
> +	ret = clk_prepare_enable(ctx->aclk);
> +	if (ret < 0) {
> +		DRM_ERROR("Failed to prepare_enable the aclk [%d]\n", ret);
> +		return;
> +	}
> +
> +	ret = clk_prepare_enable(ctx->eclk);
> +	if  (ret < 0) {
> +		DRM_ERROR("Failed to prepare_enable the eclk [%d]\n", ret);
> +		return;
> +	}
> +
> +	ret = clk_prepare_enable(ctx->vclk);
> +	if  (ret < 0) {
> +		DRM_ERROR("Failed to prepare_enable the vclk [%d]\n", ret);
> +		return;
> +	}
>  
>  	decon_init(ctx);
>  
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
> index 9661853..7c8ba61 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
> @@ -808,6 +808,7 @@ static void fimd_apply(struct fimd_context *ctx)
>  static void fimd_enable(struct exynos_drm_crtc *crtc)
>  {
>  	struct fimd_context *ctx = crtc->ctx;
> +	int ret;
>  
>  	if (!ctx->suspended)
>  		return;
> @@ -816,8 +817,17 @@ static void fimd_enable(struct exynos_drm_crtc *crtc)
>  
>  	pm_runtime_get_sync(ctx->dev);
>  
> -	clk_prepare_enable(ctx->bus_clk);
> -	clk_prepare_enable(ctx->lcd_clk);
> +	ret = clk_prepare_enable(ctx->bus_clk);
> +	if (ret < 0) {
> +		DRM_ERROR("Failed to prepare_enable the bus clk [%d]\n", ret);
> +		return;
> +	}
> +
> +	ret = clk_prepare_enable(ctx->lcd_clk);
> +	if  (ret < 0) {
> +		DRM_ERROR("Failed to prepare_enable the lcd clk [%d]\n", ret);
> +		return;
> +	}
>  
>  	/* if vblank was enabled status, enable it again. */
>  	if (test_and_clear_bit(0, &ctx->irq_flags))
> diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c
> index 6bab717..1b77fc7 100644
> --- a/drivers/gpu/drm/exynos/exynos_mixer.c
> +++ b/drivers/gpu/drm/exynos/exynos_mixer.c
> @@ -1031,6 +1031,7 @@ static void mixer_enable(struct exynos_drm_crtc *crtc)
>  {
>  	struct mixer_context *ctx = crtc->ctx;
>  	struct mixer_resources *res = &ctx->mixer_res;
> +	int ret;
>  
>  	mutex_lock(&ctx->mixer_mutex);
>  	if (ctx->powered) {
> @@ -1042,12 +1043,32 @@ static void mixer_enable(struct exynos_drm_crtc *crtc)
>  
>  	pm_runtime_get_sync(ctx->dev);
>  
> -	clk_prepare_enable(res->mixer);
> -	clk_prepare_enable(res->hdmi);
> +	ret = clk_prepare_enable(res->mixer);
> +	if (ret < 0) {
> +		DRM_ERROR("Failed to prepare_enable the mixer clk [%d]\n", ret);
> +		return;
> +	}
> +	ret = clk_prepare_enable(res->hdmi);
> +	if (ret < 0) {
> +		DRM_ERROR("Failed to prepare_enable the hdmi clk [%d]\n", ret);
> +		return;
> +	}
>  	if (ctx->vp_enabled) {
> -		clk_prepare_enable(res->vp);
> -		if (ctx->has_sclk)
> -			clk_prepare_enable(res->sclk_mixer);
> +		ret = clk_prepare_enable(res->vp);
> +		if (ret < 0) {
> +			DRM_ERROR("Failed to prepare_enable the vp clk [%d]\n",
> +				  ret);
> +			return;
> +		}
> +		if (ctx->has_sclk) {
> +			ret = clk_prepare_enable(res->sclk_mixer);
> +			if (ret < 0) {
> +				DRM_ERROR("Failed to prepare_enable the " \
> +					   "sclk_mixer clk [%d]\n",
> +					  ret);
> +				return;
> +			}
> +		}
>  	}
>  
>  	mutex_lock(&ctx->mixer_mutex);
> 

      reply	other threads:[~2015-06-11 14:12 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-03 14:30 [PATCH 1/9] drm/exynos: add error messages if clks failed to get enabled Gustavo Padovan
2015-06-03 14:30 ` [PATCH 2/9] drm/exynos: add atomic asynchronous commit Gustavo Padovan
2015-06-10  9:45   ` Joonyoung Shim
2015-06-03 14:30 ` [PATCH 3/9] drm/exynos: rename win_commit/disable to atomic-like names Gustavo Padovan
2015-06-03 14:30 ` [PATCH 4/9] drm/exynos: don't disable planes already disabled Gustavo Padovan
2015-06-03 14:30 ` [PATCH 5/9] drm/exynos: pass struct exynos_drm_plane in update/enable Gustavo Padovan
2015-06-03 14:30 ` [PATCH 6/9] drm/exynos: remove duplicated check for suspend Gustavo Padovan
2015-06-03 14:30 ` [PATCH 7/9] drm/exynos: use drm atomic state directly Gustavo Padovan
2015-06-03 14:30 ` [PATCH 8/9] drm/exynos: remove unused fields from struct exynos_drm_plane Gustavo Padovan
2015-06-03 14:30 ` [PATCH 9/9] drm/exynos: unify exynos_drm_plane names with drm core Gustavo Padovan
2015-06-09 14:27   ` Gustavo Padovan
2015-06-10  9:46     ` Joonyoung Shim
2015-06-10 10:42     ` Inki Dae
2015-06-10 10:48       ` Inki Dae
2015-06-03 16:59 ` [PATCH 1/9] drm/exynos: add error messages if clks failed to get enabled Alexey Klimov
2015-06-03 17:09   ` Alexey Klimov
2015-06-03 18:13   ` Gustavo Padovan
2015-06-03 20:17 ` [PATCH v2] " Gustavo Padovan
2015-06-11 14:12   ` Inki Dae [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5579973A.8010900@samsung.com \
    --to=inki.dae@samsung.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gustavo.padovan@collabora.co.uk \
    --cc=gustavo@padovan.org \
    --cc=jy0922.shim@samsung.com \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=tjakobi@math.uni-bielefeld.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.