All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amd/powerplay: fix a warning in pp_hw_init
@ 2017-09-29 16:38 Alex Deucher
       [not found] ` <1506703087-26162-1-git-send-email-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Alex Deucher @ 2017-09-29 16:38 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Alex Deucher

Make sure hwmgr is valid.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
index 44b0616..e96ab0b 100644
--- a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
+++ b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
@@ -146,7 +146,7 @@ static int pp_hw_init(void *handle)
 {
 	int ret = 0;
 	struct pp_instance *pp_handle = (struct pp_instance *)handle;
-	struct pp_hwmgr *hwmgr;
+	struct pp_hwmgr *hwmgr = NULL;
 
 	ret = pp_check(pp_handle);
 
@@ -171,7 +171,8 @@ static int pp_hw_init(void *handle)
 	return 0;
 exit:
 	pp_handle->pm_en = 0;
-	cgs_notify_dpm_enabled(hwmgr->device, false);
+	if (hwmgr)
+		cgs_notify_dpm_enabled(hwmgr->device, false);
 	return 0;
 
 }
-- 
2.5.5

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* RE: [PATCH] drm/amd/powerplay: fix a warning in pp_hw_init
       [not found] ` <1506703087-26162-1-git-send-email-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
@ 2017-09-30  2:41   ` Zhu, Rex
       [not found]     ` <CY4PR12MB1687AA55C8E5F3DB77EAE4B3FB7F0-rpdhrqHFk06Y0SjTqZDccQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Zhu, Rex @ 2017-09-30  2:41 UTC (permalink / raw)
  To: 'Alex Deucher', amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
  Cc: Deucher, Alexander

[-- Attachment #1: Type: text/plain, Size: 1508 bytes --]

Hi Alex,

Thanks for pointing out the logic error in pp_hw_init.
Please review the attached patch.

Best Regards
Rex



-----Original Message-----
From: amd-gfx [mailto:amd-gfx-bounces@lists.freedesktop.org] On Behalf Of Alex Deucher
Sent: Saturday, September 30, 2017 12:38 AM
To: amd-gfx@lists.freedesktop.org
Cc: Deucher, Alexander
Subject: [PATCH] drm/amd/powerplay: fix a warning in pp_hw_init

Make sure hwmgr is valid.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
index 44b0616..e96ab0b 100644
--- a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
+++ b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
@@ -146,7 +146,7 @@ static int pp_hw_init(void *handle)  {
 	int ret = 0;
 	struct pp_instance *pp_handle = (struct pp_instance *)handle;
-	struct pp_hwmgr *hwmgr;
+	struct pp_hwmgr *hwmgr = NULL;
 
 	ret = pp_check(pp_handle);
 
@@ -171,7 +171,8 @@ static int pp_hw_init(void *handle)
 	return 0;
 exit:
 	pp_handle->pm_en = 0;
-	cgs_notify_dpm_enabled(hwmgr->device, false);
+	if (hwmgr)
+		cgs_notify_dpm_enabled(hwmgr->device, false);
 	return 0;
 
 }
--
2.5.5

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

[-- Attachment #2: 0001-drm-amd-powerplay-fix-a-logic-error-in-pp_hw_init.patch --]
[-- Type: application/octet-stream, Size: 1012 bytes --]

From e253f12b5fd6c44a0ce6beb342319ea053c3ec29 Mon Sep 17 00:00:00 2001
From: Rex Zhu <Rex.Zhu@amd.com>
Date: Sat, 30 Sep 2017 10:20:52 +0800
Subject: [PATCH] drm/amd/powerplay: fix a logic error in pp_hw_init

Change-Id: I8607e51a0e4153b36268e2bcf4fe594c2bfbfe23
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
---
 drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
index df70cc7..586cab7 100644
--- a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
+++ b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
@@ -163,12 +163,11 @@ static int pp_hw_init(void *handle)
 		}
 		if (ret == PP_DPM_DISABLED)
 			goto exit;
+		ret = hwmgr_hw_init(pp_handle);
+		if (ret)
+			goto exit;
 	}
-
-	ret = hwmgr_hw_init(pp_handle);
-	if (ret)
-		goto exit;
-	return 0;
+	return ret;
 exit:
 	pp_handle->pm_en = 0;
 	cgs_notify_dpm_enabled(hwmgr->device, false);
-- 
1.9.1


[-- Attachment #3: Type: text/plain, Size: 154 bytes --]

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: [PATCH] drm/amd/powerplay: fix a warning in pp_hw_init
       [not found]     ` <CY4PR12MB1687AA55C8E5F3DB77EAE4B3FB7F0-rpdhrqHFk06Y0SjTqZDccQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
@ 2017-10-01 21:23       ` Alex Deucher
  0 siblings, 0 replies; 3+ messages in thread
From: Alex Deucher @ 2017-10-01 21:23 UTC (permalink / raw)
  To: Zhu, Rex; +Cc: Deucher, Alexander, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

On Fri, Sep 29, 2017 at 10:41 PM, Zhu, Rex <Rex.Zhu@amd.com> wrote:
> Hi Alex,
>
> Thanks for pointing out the logic error in pp_hw_init.
> Please review the attached patch.

Acked-by: Alex Deucher <alexander.deucher@amd.com>

>
> Best Regards
> Rex
>
>
>
> -----Original Message-----
> From: amd-gfx [mailto:amd-gfx-bounces@lists.freedesktop.org] On Behalf Of Alex Deucher
> Sent: Saturday, September 30, 2017 12:38 AM
> To: amd-gfx@lists.freedesktop.org
> Cc: Deucher, Alexander
> Subject: [PATCH] drm/amd/powerplay: fix a warning in pp_hw_init
>
> Make sure hwmgr is valid.
>
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> ---
>  drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
> index 44b0616..e96ab0b 100644
> --- a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
> +++ b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
> @@ -146,7 +146,7 @@ static int pp_hw_init(void *handle)  {
>         int ret = 0;
>         struct pp_instance *pp_handle = (struct pp_instance *)handle;
> -       struct pp_hwmgr *hwmgr;
> +       struct pp_hwmgr *hwmgr = NULL;
>
>         ret = pp_check(pp_handle);
>
> @@ -171,7 +171,8 @@ static int pp_hw_init(void *handle)
>         return 0;
>  exit:
>         pp_handle->pm_en = 0;
> -       cgs_notify_dpm_enabled(hwmgr->device, false);
> +       if (hwmgr)
> +               cgs_notify_dpm_enabled(hwmgr->device, false);
>         return 0;
>
>  }
> --
> 2.5.5
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

end of thread, other threads:[~2017-10-01 21:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-29 16:38 [PATCH] drm/amd/powerplay: fix a warning in pp_hw_init Alex Deucher
     [not found] ` <1506703087-26162-1-git-send-email-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
2017-09-30  2:41   ` Zhu, Rex
     [not found]     ` <CY4PR12MB1687AA55C8E5F3DB77EAE4B3FB7F0-rpdhrqHFk06Y0SjTqZDccQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2017-10-01 21:23       ` Alex Deucher

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.