All of lore.kernel.org
 help / color / mirror / Atom feed
From: walter harms <wharms@bfs.de>
To: Christophe JAILLET
	<christophe.jaillet-39ZsbGIQGT5GWvitb5QawA@public.gmane.org>
Cc: freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
	architt-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org,
	airlied-cv59FeDIM0c@public.gmane.org,
	linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	yongjun_wei-zrsr2BFq86L20UzCJQGyNP8+0UxHXcjY@public.gmane.org,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	robdclark-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	hali-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org
Subject: Re: [PATCH v2] drm/msm/dsi: Fix the releasing of resources in error path in 'dsi_bus_clk_enable()'
Date: Sun, 26 Feb 2017 14:28:44 +0000	[thread overview]
Message-ID: <58B2E61C.7020205@bfs.de> (raw)
In-Reply-To: <20170226121057.9717-1-christophe.jaillet-39ZsbGIQGT5GWvitb5QawA@public.gmane.org>

looks good to me.

Reviewed-by: wharms@bfs.de

Am 26.02.2017 13:10, schrieb Christophe JAILLET:
> If a 'clk_prepare_enable()' fails, then we need to disable_unprepare the
> clk already handled.
> 
> With the current implemenatation, we try to do that on the clk that has
> triggered the error, which is a no-op and leave msm_host->bus_clks[0]
> untouched.
> 
> Count forward in order to fix it and be more future proof.
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> v2: change the for loop from a backward to a forward one, to ease reading.
> ---
>  drivers/gpu/drm/msm/dsi/dsi_host.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c
> index 1fc07ce24686..e6f56cd8ce08 100644
> --- a/drivers/gpu/drm/msm/dsi/dsi_host.c
> +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c
> @@ -422,7 +422,7 @@ static int dsi_clk_init(struct msm_dsi_host *msm_host)
>  static int dsi_bus_clk_enable(struct msm_dsi_host *msm_host)
>  {
>  	const struct msm_dsi_config *cfg = msm_host->cfg_hnd->cfg;
> -	int i, ret;
> +	int i, j, ret;
>  
>  	DBG("id=%d", msm_host->id);
>  
> @@ -437,8 +437,8 @@ static int dsi_bus_clk_enable(struct msm_dsi_host *msm_host)
>  
>  	return 0;
>  err:
> -	for (; i > 0; i--)
> -		clk_disable_unprepare(msm_host->bus_clks[i]);
> +	for (j = 0; j < i; j++)
> +		clk_disable_unprepare(msm_host->bus_clks[j]);
>  
>  	return ret;
>  }

WARNING: multiple messages have this Message-ID (diff)
From: walter harms <wharms-fPG8STNUNVg@public.gmane.org>
To: Christophe JAILLET
	<christophe.jaillet-39ZsbGIQGT5GWvitb5QawA@public.gmane.org>
Cc: freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
	architt-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org,
	airlied-cv59FeDIM0c@public.gmane.org,
	linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	yongjun_wei-zrsr2BFq86L20UzCJQGyNP8+0UxHXcjY@public.gmane.org,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	robdclark-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	hali-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org
Subject: Re: [PATCH v2] drm/msm/dsi: Fix the releasing of resources in error path in 'dsi_bus_clk_enable()'
Date: Sun, 26 Feb 2017 15:28:44 +0100	[thread overview]
Message-ID: <58B2E61C.7020205@bfs.de> (raw)
In-Reply-To: <20170226121057.9717-1-christophe.jaillet-39ZsbGIQGT5GWvitb5QawA@public.gmane.org>

looks good to me.

Reviewed-by: wharms@bfs.de

Am 26.02.2017 13:10, schrieb Christophe JAILLET:
> If a 'clk_prepare_enable()' fails, then we need to disable_unprepare the
> clk already handled.
> 
> With the current implemenatation, we try to do that on the clk that has
> triggered the error, which is a no-op and leave msm_host->bus_clks[0]
> untouched.
> 
> Count forward in order to fix it and be more future proof.
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> v2: change the for loop from a backward to a forward one, to ease reading.
> ---
>  drivers/gpu/drm/msm/dsi/dsi_host.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c
> index 1fc07ce24686..e6f56cd8ce08 100644
> --- a/drivers/gpu/drm/msm/dsi/dsi_host.c
> +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c
> @@ -422,7 +422,7 @@ static int dsi_clk_init(struct msm_dsi_host *msm_host)
>  static int dsi_bus_clk_enable(struct msm_dsi_host *msm_host)
>  {
>  	const struct msm_dsi_config *cfg = msm_host->cfg_hnd->cfg;
> -	int i, ret;
> +	int i, j, ret;
>  
>  	DBG("id=%d", msm_host->id);
>  
> @@ -437,8 +437,8 @@ static int dsi_bus_clk_enable(struct msm_dsi_host *msm_host)
>  
>  	return 0;
>  err:
> -	for (; i > 0; i--)
> -		clk_disable_unprepare(msm_host->bus_clks[i]);
> +	for (j = 0; j < i; j++)
> +		clk_disable_unprepare(msm_host->bus_clks[j]);
>  
>  	return ret;
>  }
_______________________________________________
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno

WARNING: multiple messages have this Message-ID (diff)
From: walter harms <wharms@bfs.de>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: robdclark@gmail.com, airlied@linux.ie, architt@codeaurora.org,
	hali@codeaurora.org, yongjun_wei@trendmicro.com.cn,
	linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org,
	freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	kernel-janitors@vger.kernel.org
Subject: Re: [PATCH v2] drm/msm/dsi: Fix the releasing of resources in error path in 'dsi_bus_clk_enable()'
Date: Sun, 26 Feb 2017 15:28:44 +0100	[thread overview]
Message-ID: <58B2E61C.7020205@bfs.de> (raw)
In-Reply-To: <20170226121057.9717-1-christophe.jaillet@wanadoo.fr>

looks good to me.

Reviewed-by: wharms@bfs.de

Am 26.02.2017 13:10, schrieb Christophe JAILLET:
> If a 'clk_prepare_enable()' fails, then we need to disable_unprepare the
> clk already handled.
> 
> With the current implemenatation, we try to do that on the clk that has
> triggered the error, which is a no-op and leave msm_host->bus_clks[0]
> untouched.
> 
> Count forward in order to fix it and be more future proof.
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> v2: change the for loop from a backward to a forward one, to ease reading.
> ---
>  drivers/gpu/drm/msm/dsi/dsi_host.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c
> index 1fc07ce24686..e6f56cd8ce08 100644
> --- a/drivers/gpu/drm/msm/dsi/dsi_host.c
> +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c
> @@ -422,7 +422,7 @@ static int dsi_clk_init(struct msm_dsi_host *msm_host)
>  static int dsi_bus_clk_enable(struct msm_dsi_host *msm_host)
>  {
>  	const struct msm_dsi_config *cfg = msm_host->cfg_hnd->cfg;
> -	int i, ret;
> +	int i, j, ret;
>  
>  	DBG("id=%d", msm_host->id);
>  
> @@ -437,8 +437,8 @@ static int dsi_bus_clk_enable(struct msm_dsi_host *msm_host)
>  
>  	return 0;
>  err:
> -	for (; i > 0; i--)
> -		clk_disable_unprepare(msm_host->bus_clks[i]);
> +	for (j = 0; j < i; j++)
> +		clk_disable_unprepare(msm_host->bus_clks[j]);
>  
>  	return ret;
>  }

  parent reply	other threads:[~2017-02-26 14:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-26 12:10 [PATCH v2] drm/msm/dsi: Fix the releasing of resources in error path in 'dsi_bus_clk_enable()' Christophe JAILLET
2017-02-26 12:10 ` Christophe JAILLET
2017-02-26 12:10 ` Christophe JAILLET
     [not found] ` <20170226121057.9717-1-christophe.jaillet-39ZsbGIQGT5GWvitb5QawA@public.gmane.org>
2017-02-26 14:28   ` walter harms [this message]
2017-02-26 14:28     ` walter harms
2017-02-26 14:28     ` walter harms
2017-02-26 15:25   ` Rob Clark
2017-02-26 15:25     ` Rob Clark
2017-02-26 15:25     ` Rob Clark
2017-02-26 19:39 ` Christophe JAILLET

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=58B2E61C.7020205@bfs.de \
    --to=wharms@bfs.de \
    --cc=airlied-cv59FeDIM0c@public.gmane.org \
    --cc=architt-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
    --cc=christophe.jaillet-39ZsbGIQGT5GWvitb5QawA@public.gmane.org \
    --cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=hali-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
    --cc=kernel-janitors-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=robdclark-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=yongjun_wei-zrsr2BFq86L20UzCJQGyNP8+0UxHXcjY@public.gmane.org \
    /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.