All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] drm/rockchip: cdn-dp: Fix error handling
@ 2017-02-20  7:08 ` Christophe JAILLET
  0 siblings, 0 replies; 11+ messages in thread
From: Christophe JAILLET @ 2017-02-20  7:08 UTC (permalink / raw)
  To: mark.yao, airlied, heiko
  Cc: dri-devel, linux-arm-kernel, linux-rockchip, linux-kernel,
	kernel-janitors, Christophe JAILLET

It is likely that both 'clk_disable_unprepare()' should be called if
'pm_runtime_get_sync()' fails.

Add a new label for that, because 'err_set_rate' is not meaningful in this
case.

Add a missing call to 'pm_runtime_put()'.

Fixes: 1a0f7ed3abe2 ("drm/rockchip: cdn-dp: add cdn DP support for rk3399")

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
V2: rename label
    add missing call to 'pm_runtime_put_sync()' in error path
---
 drivers/gpu/drm/rockchip/cdn-dp-core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/rockchip/cdn-dp-core.c b/drivers/gpu/drm/rockchip/cdn-dp-core.c
index 9ab67a670885..0fe1ec8b8fb1 100644
--- a/drivers/gpu/drm/rockchip/cdn-dp-core.c
+++ b/drivers/gpu/drm/rockchip/cdn-dp-core.c
@@ -111,7 +111,7 @@ static int cdn_dp_clk_enable(struct cdn_dp_device *dp)
 	ret = pm_runtime_get_sync(dp->dev);
 	if (ret < 0) {
 		DRM_DEV_ERROR(dp->dev, "cannot get pm runtime %d\n", ret);
-		goto err_pclk;
+		goto err_pm_runtime_get;
 	}
 
 	reset_control_assert(dp->core_rst);
@@ -133,6 +133,8 @@ static int cdn_dp_clk_enable(struct cdn_dp_device *dp)
 	return 0;
 
 err_set_rate:
+	pm_runtime_put(dp->dev);
+err_pm_runtime_get:
 	clk_disable_unprepare(dp->core_clk);
 err_core_clk:
 	clk_disable_unprepare(dp->pclk);
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH v2] drm/rockchip: cdn-dp: Fix error handling
@ 2017-02-20  7:08 ` Christophe JAILLET
  0 siblings, 0 replies; 11+ messages in thread
From: Christophe JAILLET @ 2017-02-20  7:08 UTC (permalink / raw)
  To: mark.yao, airlied, heiko
  Cc: dri-devel, linux-arm-kernel, linux-rockchip, linux-kernel,
	kernel-janitors, Christophe JAILLET

It is likely that both 'clk_disable_unprepare()' should be called if
'pm_runtime_get_sync()' fails.

Add a new label for that, because 'err_set_rate' is not meaningful in this
case.

Add a missing call to 'pm_runtime_put()'.

Fixes: 1a0f7ed3abe2 ("drm/rockchip: cdn-dp: add cdn DP support for rk3399")

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
V2: rename label
    add missing call to 'pm_runtime_put_sync()' in error path
---
 drivers/gpu/drm/rockchip/cdn-dp-core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/rockchip/cdn-dp-core.c b/drivers/gpu/drm/rockchip/cdn-dp-core.c
index 9ab67a670885..0fe1ec8b8fb1 100644
--- a/drivers/gpu/drm/rockchip/cdn-dp-core.c
+++ b/drivers/gpu/drm/rockchip/cdn-dp-core.c
@@ -111,7 +111,7 @@ static int cdn_dp_clk_enable(struct cdn_dp_device *dp)
 	ret = pm_runtime_get_sync(dp->dev);
 	if (ret < 0) {
 		DRM_DEV_ERROR(dp->dev, "cannot get pm runtime %d\n", ret);
-		goto err_pclk;
+		goto err_pm_runtime_get;
 	}
 
 	reset_control_assert(dp->core_rst);
@@ -133,6 +133,8 @@ static int cdn_dp_clk_enable(struct cdn_dp_device *dp)
 	return 0;
 
 err_set_rate:
+	pm_runtime_put(dp->dev);
+err_pm_runtime_get:
 	clk_disable_unprepare(dp->core_clk);
 err_core_clk:
 	clk_disable_unprepare(dp->pclk);
-- 
2.9.3


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH v2] drm/rockchip: cdn-dp: Fix error handling
@ 2017-02-20  7:08 ` Christophe JAILLET
  0 siblings, 0 replies; 11+ messages in thread
From: Christophe JAILLET @ 2017-02-20  7:08 UTC (permalink / raw)
  To: linux-arm-kernel

It is likely that both 'clk_disable_unprepare()' should be called if
'pm_runtime_get_sync()' fails.

Add a new label for that, because 'err_set_rate' is not meaningful in this
case.

Add a missing call to 'pm_runtime_put()'.

Fixes: 1a0f7ed3abe2 ("drm/rockchip: cdn-dp: add cdn DP support for rk3399")

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
V2: rename label
    add missing call to 'pm_runtime_put_sync()' in error path
---
 drivers/gpu/drm/rockchip/cdn-dp-core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/rockchip/cdn-dp-core.c b/drivers/gpu/drm/rockchip/cdn-dp-core.c
index 9ab67a670885..0fe1ec8b8fb1 100644
--- a/drivers/gpu/drm/rockchip/cdn-dp-core.c
+++ b/drivers/gpu/drm/rockchip/cdn-dp-core.c
@@ -111,7 +111,7 @@ static int cdn_dp_clk_enable(struct cdn_dp_device *dp)
 	ret = pm_runtime_get_sync(dp->dev);
 	if (ret < 0) {
 		DRM_DEV_ERROR(dp->dev, "cannot get pm runtime %d\n", ret);
-		goto err_pclk;
+		goto err_pm_runtime_get;
 	}
 
 	reset_control_assert(dp->core_rst);
@@ -133,6 +133,8 @@ static int cdn_dp_clk_enable(struct cdn_dp_device *dp)
 	return 0;
 
 err_set_rate:
+	pm_runtime_put(dp->dev);
+err_pm_runtime_get:
 	clk_disable_unprepare(dp->core_clk);
 err_core_clk:
 	clk_disable_unprepare(dp->pclk);
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH v2] drm/rockchip: cdn-dp: Fix error handling
  2017-02-20  7:08 ` Christophe JAILLET
  (?)
  (?)
@ 2017-02-20  7:34   ` Mark yao
  -1 siblings, 0 replies; 11+ messages in thread
From: Mark yao @ 2017-02-20  7:34 UTC (permalink / raw)
  To: Christophe JAILLET, airlied, heiko
  Cc: dri-devel, linux-arm-kernel, linux-rockchip, linux-kernel,
	kernel-janitors

On 2017年02月20日 15:08, Christophe JAILLET wrote:
> It is likely that both 'clk_disable_unprepare()' should be called if
> 'pm_runtime_get_sync()' fails.
>
> Add a new label for that, because 'err_set_rate' is not meaningful in this
> case.
>
> Add a missing call to 'pm_runtime_put()'.
>
> Fixes: 1a0f7ed3abe2 ("drm/rockchip: cdn-dp: add cdn DP support for rk3399")
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

looks good for me

Reviewed-by: Mark Yao <mark.yao@rock-chips.com>


> ---
> V2: rename label
>      add missing call to 'pm_runtime_put_sync()' in error path
> ---
>   drivers/gpu/drm/rockchip/cdn-dp-core.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/rockchip/cdn-dp-core.c b/drivers/gpu/drm/rockchip/cdn-dp-core.c
> index 9ab67a670885..0fe1ec8b8fb1 100644
> --- a/drivers/gpu/drm/rockchip/cdn-dp-core.c
> +++ b/drivers/gpu/drm/rockchip/cdn-dp-core.c
> @@ -111,7 +111,7 @@ static int cdn_dp_clk_enable(struct cdn_dp_device *dp)
>   	ret = pm_runtime_get_sync(dp->dev);
>   	if (ret < 0) {
>   		DRM_DEV_ERROR(dp->dev, "cannot get pm runtime %d\n", ret);
> -		goto err_pclk;
> +		goto err_pm_runtime_get;
>   	}
>   
>   	reset_control_assert(dp->core_rst);
> @@ -133,6 +133,8 @@ static int cdn_dp_clk_enable(struct cdn_dp_device *dp)
>   	return 0;
>   
>   err_set_rate:
> +	pm_runtime_put(dp->dev);
> +err_pm_runtime_get:
>   	clk_disable_unprepare(dp->core_clk);
>   err_core_clk:
>   	clk_disable_unprepare(dp->pclk);


-- 
Mark Yao

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2] drm/rockchip: cdn-dp: Fix error handling
@ 2017-02-20  7:34   ` Mark yao
  0 siblings, 0 replies; 11+ messages in thread
From: Mark yao @ 2017-02-20  7:34 UTC (permalink / raw)
  To: Christophe JAILLET, airlied, heiko
  Cc: linux-rockchip, kernel-janitors, linux-arm-kernel, dri-devel,
	linux-kernel

On 2017年02月20日 15:08, Christophe JAILLET wrote:
> It is likely that both 'clk_disable_unprepare()' should be called if
> 'pm_runtime_get_sync()' fails.
>
> Add a new label for that, because 'err_set_rate' is not meaningful in this
> case.
>
> Add a missing call to 'pm_runtime_put()'.
>
> Fixes: 1a0f7ed3abe2 ("drm/rockchip: cdn-dp: add cdn DP support for rk3399")
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

looks good for me

Reviewed-by: Mark Yao <mark.yao@rock-chips.com>


> ---
> V2: rename label
>      add missing call to 'pm_runtime_put_sync()' in error path
> ---
>   drivers/gpu/drm/rockchip/cdn-dp-core.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/rockchip/cdn-dp-core.c b/drivers/gpu/drm/rockchip/cdn-dp-core.c
> index 9ab67a670885..0fe1ec8b8fb1 100644
> --- a/drivers/gpu/drm/rockchip/cdn-dp-core.c
> +++ b/drivers/gpu/drm/rockchip/cdn-dp-core.c
> @@ -111,7 +111,7 @@ static int cdn_dp_clk_enable(struct cdn_dp_device *dp)
>   	ret = pm_runtime_get_sync(dp->dev);
>   	if (ret < 0) {
>   		DRM_DEV_ERROR(dp->dev, "cannot get pm runtime %d\n", ret);
> -		goto err_pclk;
> +		goto err_pm_runtime_get;
>   	}
>   
>   	reset_control_assert(dp->core_rst);
> @@ -133,6 +133,8 @@ static int cdn_dp_clk_enable(struct cdn_dp_device *dp)
>   	return 0;
>   
>   err_set_rate:
> +	pm_runtime_put(dp->dev);
> +err_pm_runtime_get:
>   	clk_disable_unprepare(dp->core_clk);
>   err_core_clk:
>   	clk_disable_unprepare(dp->pclk);


-- 
Mark Yao



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2] drm/rockchip: cdn-dp: Fix error handling
@ 2017-02-20  7:34   ` Mark yao
  0 siblings, 0 replies; 11+ messages in thread
From: Mark yao @ 2017-02-20  7:34 UTC (permalink / raw)
  To: Christophe JAILLET, airlied, heiko
  Cc: linux-rockchip, kernel-janitors, linux-arm-kernel, dri-devel,
	linux-kernel

On 2017年02月20日 15:08, Christophe JAILLET wrote:
> It is likely that both 'clk_disable_unprepare()' should be called if
> 'pm_runtime_get_sync()' fails.
>
> Add a new label for that, because 'err_set_rate' is not meaningful in this
> case.
>
> Add a missing call to 'pm_runtime_put()'.
>
> Fixes: 1a0f7ed3abe2 ("drm/rockchip: cdn-dp: add cdn DP support for rk3399")
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

looks good for me

Reviewed-by: Mark Yao <mark.yao@rock-chips.com>


> ---
> V2: rename label
>      add missing call to 'pm_runtime_put_sync()' in error path
> ---
>   drivers/gpu/drm/rockchip/cdn-dp-core.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/rockchip/cdn-dp-core.c b/drivers/gpu/drm/rockchip/cdn-dp-core.c
> index 9ab67a670885..0fe1ec8b8fb1 100644
> --- a/drivers/gpu/drm/rockchip/cdn-dp-core.c
> +++ b/drivers/gpu/drm/rockchip/cdn-dp-core.c
> @@ -111,7 +111,7 @@ static int cdn_dp_clk_enable(struct cdn_dp_device *dp)
>   	ret = pm_runtime_get_sync(dp->dev);
>   	if (ret < 0) {
>   		DRM_DEV_ERROR(dp->dev, "cannot get pm runtime %d\n", ret);
> -		goto err_pclk;
> +		goto err_pm_runtime_get;
>   	}
>   
>   	reset_control_assert(dp->core_rst);
> @@ -133,6 +133,8 @@ static int cdn_dp_clk_enable(struct cdn_dp_device *dp)
>   	return 0;
>   
>   err_set_rate:
> +	pm_runtime_put(dp->dev);
> +err_pm_runtime_get:
>   	clk_disable_unprepare(dp->core_clk);
>   err_core_clk:
>   	clk_disable_unprepare(dp->pclk);


-- 
Mark Yao


_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH v2] drm/rockchip: cdn-dp: Fix error handling
@ 2017-02-20  7:34   ` Mark yao
  0 siblings, 0 replies; 11+ messages in thread
From: Mark yao @ 2017-02-20  7:34 UTC (permalink / raw)
  To: linux-arm-kernel

On 2017?02?20? 15:08, Christophe JAILLET wrote:
> It is likely that both 'clk_disable_unprepare()' should be called if
> 'pm_runtime_get_sync()' fails.
>
> Add a new label for that, because 'err_set_rate' is not meaningful in this
> case.
>
> Add a missing call to 'pm_runtime_put()'.
>
> Fixes: 1a0f7ed3abe2 ("drm/rockchip: cdn-dp: add cdn DP support for rk3399")
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

looks good for me

Reviewed-by: Mark Yao <mark.yao@rock-chips.com>


> ---
> V2: rename label
>      add missing call to 'pm_runtime_put_sync()' in error path
> ---
>   drivers/gpu/drm/rockchip/cdn-dp-core.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/rockchip/cdn-dp-core.c b/drivers/gpu/drm/rockchip/cdn-dp-core.c
> index 9ab67a670885..0fe1ec8b8fb1 100644
> --- a/drivers/gpu/drm/rockchip/cdn-dp-core.c
> +++ b/drivers/gpu/drm/rockchip/cdn-dp-core.c
> @@ -111,7 +111,7 @@ static int cdn_dp_clk_enable(struct cdn_dp_device *dp)
>   	ret = pm_runtime_get_sync(dp->dev);
>   	if (ret < 0) {
>   		DRM_DEV_ERROR(dp->dev, "cannot get pm runtime %d\n", ret);
> -		goto err_pclk;
> +		goto err_pm_runtime_get;
>   	}
>   
>   	reset_control_assert(dp->core_rst);
> @@ -133,6 +133,8 @@ static int cdn_dp_clk_enable(struct cdn_dp_device *dp)
>   	return 0;
>   
>   err_set_rate:
> +	pm_runtime_put(dp->dev);
> +err_pm_runtime_get:
>   	clk_disable_unprepare(dp->core_clk);
>   err_core_clk:
>   	clk_disable_unprepare(dp->pclk);


-- 
?ark Yao

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2] drm/rockchip: cdn-dp: Fix error handling
  2017-02-20  7:08 ` Christophe JAILLET
  (?)
  (?)
@ 2017-02-23 16:48   ` Sean Paul
  -1 siblings, 0 replies; 11+ messages in thread
From: Sean Paul @ 2017-02-23 16:48 UTC (permalink / raw)
  To: Christophe JAILLET
  Cc: mark.yao, airlied, heiko, dri-devel, linux-arm-kernel,
	linux-rockchip, linux-kernel, kernel-janitors

On Mon, Feb 20, 2017 at 08:08:15AM +0100, Christophe JAILLET wrote:
> It is likely that both 'clk_disable_unprepare()' should be called if
> 'pm_runtime_get_sync()' fails.
> 
> Add a new label for that, because 'err_set_rate' is not meaningful in this
> case.
> 
> Add a missing call to 'pm_runtime_put()'.
> 
> Fixes: 1a0f7ed3abe2 ("drm/rockchip: cdn-dp: add cdn DP support for rk3399")
> 

Applied to drm-misc-next-fixes

Thanks,

Sean

> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> V2: rename label
>     add missing call to 'pm_runtime_put_sync()' in error path
> ---
>  drivers/gpu/drm/rockchip/cdn-dp-core.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/rockchip/cdn-dp-core.c b/drivers/gpu/drm/rockchip/cdn-dp-core.c
> index 9ab67a670885..0fe1ec8b8fb1 100644
> --- a/drivers/gpu/drm/rockchip/cdn-dp-core.c
> +++ b/drivers/gpu/drm/rockchip/cdn-dp-core.c
> @@ -111,7 +111,7 @@ static int cdn_dp_clk_enable(struct cdn_dp_device *dp)
>  	ret = pm_runtime_get_sync(dp->dev);
>  	if (ret < 0) {
>  		DRM_DEV_ERROR(dp->dev, "cannot get pm runtime %d\n", ret);
> -		goto err_pclk;
> +		goto err_pm_runtime_get;
>  	}
>  
>  	reset_control_assert(dp->core_rst);
> @@ -133,6 +133,8 @@ static int cdn_dp_clk_enable(struct cdn_dp_device *dp)
>  	return 0;
>  
>  err_set_rate:
> +	pm_runtime_put(dp->dev);
> +err_pm_runtime_get:
>  	clk_disable_unprepare(dp->core_clk);
>  err_core_clk:
>  	clk_disable_unprepare(dp->pclk);
> -- 
> 2.9.3

-- 
Sean Paul, Software Engineer, Google / Chromium OS

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2] drm/rockchip: cdn-dp: Fix error handling
@ 2017-02-23 16:48   ` Sean Paul
  0 siblings, 0 replies; 11+ messages in thread
From: Sean Paul @ 2017-02-23 16:48 UTC (permalink / raw)
  To: Christophe JAILLET
  Cc: kernel-janitors, linux-kernel, dri-devel, linux-rockchip,
	linux-arm-kernel

On Mon, Feb 20, 2017 at 08:08:15AM +0100, Christophe JAILLET wrote:
> It is likely that both 'clk_disable_unprepare()' should be called if
> 'pm_runtime_get_sync()' fails.
> 
> Add a new label for that, because 'err_set_rate' is not meaningful in this
> case.
> 
> Add a missing call to 'pm_runtime_put()'.
> 
> Fixes: 1a0f7ed3abe2 ("drm/rockchip: cdn-dp: add cdn DP support for rk3399")
> 

Applied to drm-misc-next-fixes

Thanks,

Sean

> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> V2: rename label
>     add missing call to 'pm_runtime_put_sync()' in error path
> ---
>  drivers/gpu/drm/rockchip/cdn-dp-core.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/rockchip/cdn-dp-core.c b/drivers/gpu/drm/rockchip/cdn-dp-core.c
> index 9ab67a670885..0fe1ec8b8fb1 100644
> --- a/drivers/gpu/drm/rockchip/cdn-dp-core.c
> +++ b/drivers/gpu/drm/rockchip/cdn-dp-core.c
> @@ -111,7 +111,7 @@ static int cdn_dp_clk_enable(struct cdn_dp_device *dp)
>  	ret = pm_runtime_get_sync(dp->dev);
>  	if (ret < 0) {
>  		DRM_DEV_ERROR(dp->dev, "cannot get pm runtime %d\n", ret);
> -		goto err_pclk;
> +		goto err_pm_runtime_get;
>  	}
>  
>  	reset_control_assert(dp->core_rst);
> @@ -133,6 +133,8 @@ static int cdn_dp_clk_enable(struct cdn_dp_device *dp)
>  	return 0;
>  
>  err_set_rate:
> +	pm_runtime_put(dp->dev);
> +err_pm_runtime_get:
>  	clk_disable_unprepare(dp->core_clk);
>  err_core_clk:
>  	clk_disable_unprepare(dp->pclk);
> -- 
> 2.9.3

-- 
Sean Paul, Software Engineer, Google / Chromium OS

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2] drm/rockchip: cdn-dp: Fix error handling
@ 2017-02-23 16:48   ` Sean Paul
  0 siblings, 0 replies; 11+ messages in thread
From: Sean Paul @ 2017-02-23 16:48 UTC (permalink / raw)
  To: Christophe JAILLET
  Cc: kernel-janitors, linux-kernel, dri-devel, linux-rockchip,
	linux-arm-kernel

On Mon, Feb 20, 2017 at 08:08:15AM +0100, Christophe JAILLET wrote:
> It is likely that both 'clk_disable_unprepare()' should be called if
> 'pm_runtime_get_sync()' fails.
> 
> Add a new label for that, because 'err_set_rate' is not meaningful in this
> case.
> 
> Add a missing call to 'pm_runtime_put()'.
> 
> Fixes: 1a0f7ed3abe2 ("drm/rockchip: cdn-dp: add cdn DP support for rk3399")
> 

Applied to drm-misc-next-fixes

Thanks,

Sean

> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> V2: rename label
>     add missing call to 'pm_runtime_put_sync()' in error path
> ---
>  drivers/gpu/drm/rockchip/cdn-dp-core.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/rockchip/cdn-dp-core.c b/drivers/gpu/drm/rockchip/cdn-dp-core.c
> index 9ab67a670885..0fe1ec8b8fb1 100644
> --- a/drivers/gpu/drm/rockchip/cdn-dp-core.c
> +++ b/drivers/gpu/drm/rockchip/cdn-dp-core.c
> @@ -111,7 +111,7 @@ static int cdn_dp_clk_enable(struct cdn_dp_device *dp)
>  	ret = pm_runtime_get_sync(dp->dev);
>  	if (ret < 0) {
>  		DRM_DEV_ERROR(dp->dev, "cannot get pm runtime %d\n", ret);
> -		goto err_pclk;
> +		goto err_pm_runtime_get;
>  	}
>  
>  	reset_control_assert(dp->core_rst);
> @@ -133,6 +133,8 @@ static int cdn_dp_clk_enable(struct cdn_dp_device *dp)
>  	return 0;
>  
>  err_set_rate:
> +	pm_runtime_put(dp->dev);
> +err_pm_runtime_get:
>  	clk_disable_unprepare(dp->core_clk);
>  err_core_clk:
>  	clk_disable_unprepare(dp->pclk);
> -- 
> 2.9.3

-- 
Sean Paul, Software Engineer, Google / Chromium OS
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH v2] drm/rockchip: cdn-dp: Fix error handling
@ 2017-02-23 16:48   ` Sean Paul
  0 siblings, 0 replies; 11+ messages in thread
From: Sean Paul @ 2017-02-23 16:48 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Feb 20, 2017 at 08:08:15AM +0100, Christophe JAILLET wrote:
> It is likely that both 'clk_disable_unprepare()' should be called if
> 'pm_runtime_get_sync()' fails.
> 
> Add a new label for that, because 'err_set_rate' is not meaningful in this
> case.
> 
> Add a missing call to 'pm_runtime_put()'.
> 
> Fixes: 1a0f7ed3abe2 ("drm/rockchip: cdn-dp: add cdn DP support for rk3399")
> 

Applied to drm-misc-next-fixes

Thanks,

Sean

> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> V2: rename label
>     add missing call to 'pm_runtime_put_sync()' in error path
> ---
>  drivers/gpu/drm/rockchip/cdn-dp-core.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/rockchip/cdn-dp-core.c b/drivers/gpu/drm/rockchip/cdn-dp-core.c
> index 9ab67a670885..0fe1ec8b8fb1 100644
> --- a/drivers/gpu/drm/rockchip/cdn-dp-core.c
> +++ b/drivers/gpu/drm/rockchip/cdn-dp-core.c
> @@ -111,7 +111,7 @@ static int cdn_dp_clk_enable(struct cdn_dp_device *dp)
>  	ret = pm_runtime_get_sync(dp->dev);
>  	if (ret < 0) {
>  		DRM_DEV_ERROR(dp->dev, "cannot get pm runtime %d\n", ret);
> -		goto err_pclk;
> +		goto err_pm_runtime_get;
>  	}
>  
>  	reset_control_assert(dp->core_rst);
> @@ -133,6 +133,8 @@ static int cdn_dp_clk_enable(struct cdn_dp_device *dp)
>  	return 0;
>  
>  err_set_rate:
> +	pm_runtime_put(dp->dev);
> +err_pm_runtime_get:
>  	clk_disable_unprepare(dp->core_clk);
>  err_core_clk:
>  	clk_disable_unprepare(dp->pclk);
> -- 
> 2.9.3

-- 
Sean Paul, Software Engineer, Google / Chromium OS

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2017-02-23 16:56 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-20  7:08 [PATCH v2] drm/rockchip: cdn-dp: Fix error handling Christophe JAILLET
2017-02-20  7:08 ` Christophe JAILLET
2017-02-20  7:08 ` Christophe JAILLET
2017-02-20  7:34 ` Mark yao
2017-02-20  7:34   ` Mark yao
2017-02-20  7:34   ` Mark yao
2017-02-20  7:34   ` Mark yao
2017-02-23 16:48 ` Sean Paul
2017-02-23 16:48   ` Sean Paul
2017-02-23 16:48   ` Sean Paul
2017-02-23 16:48   ` Sean Paul

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.