All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: fix vega20 pstate status change
@ 2019-11-06 14:04 ` Kim, Jonathan
  0 siblings, 0 replies; 4+ messages in thread
From: Kim, Jonathan @ 2019-11-06 14:04 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
  Cc: Strawbridge, Michael, Kuehling, Felix, Quan, Evan, Kim, Jonathan

vega20 only requires all devices be set to same pstate level for low
pstate and not high.

Change-Id: I399c84a47f6e24abca937ce950685c0c7f0e3279
Signed-off-by: Jonathan Kim <Jonathan.Kim@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c
index de20a9a1c444..61d13d8b7b20 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c
@@ -276,6 +276,7 @@ int amdgpu_xgmi_set_pstate(struct amdgpu_device *adev, int pstate)
 	struct amdgpu_hive_info *hive = amdgpu_get_xgmi_hive(adev, 0);
 	struct amdgpu_device *tmp_adev;
 	bool update_hive_pstate = true;
+	bool is_high_pstate = pstate && adev->asic_type == CHIP_VEGA20;
 
 	if (!hive)
 		return 0;
@@ -283,8 +284,8 @@ int amdgpu_xgmi_set_pstate(struct amdgpu_device *adev, int pstate)
 	mutex_lock(&hive->hive_lock);
 
 	if (hive->pstate == pstate) {
-		mutex_unlock(&hive->hive_lock);
-		return 0;
+		adev->pstate = is_high_pstate ? pstate : adev->pstate;
+		goto out;
 	}
 
 	dev_dbg(adev->dev, "Set xgmi pstate %d.\n", pstate);
@@ -317,7 +318,7 @@ int amdgpu_xgmi_set_pstate(struct amdgpu_device *adev, int pstate)
 			break;
 		}
 	}
-	if (update_hive_pstate)
+	if (update_hive_pstate || is_high_pstate)
 		hive->pstate = pstate;
 
 out:
-- 
2.17.1

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

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

* [PATCH] drm/amdgpu: fix vega20 pstate status change
@ 2019-11-06 14:04 ` Kim, Jonathan
  0 siblings, 0 replies; 4+ messages in thread
From: Kim, Jonathan @ 2019-11-06 14:04 UTC (permalink / raw)
  To: amd-gfx; +Cc: Strawbridge, Michael, Kuehling, Felix, Quan, Evan, Kim, Jonathan

vega20 only requires all devices be set to same pstate level for low
pstate and not high.

Change-Id: I399c84a47f6e24abca937ce950685c0c7f0e3279
Signed-off-by: Jonathan Kim <Jonathan.Kim@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c
index de20a9a1c444..61d13d8b7b20 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c
@@ -276,6 +276,7 @@ int amdgpu_xgmi_set_pstate(struct amdgpu_device *adev, int pstate)
 	struct amdgpu_hive_info *hive = amdgpu_get_xgmi_hive(adev, 0);
 	struct amdgpu_device *tmp_adev;
 	bool update_hive_pstate = true;
+	bool is_high_pstate = pstate && adev->asic_type == CHIP_VEGA20;
 
 	if (!hive)
 		return 0;
@@ -283,8 +284,8 @@ int amdgpu_xgmi_set_pstate(struct amdgpu_device *adev, int pstate)
 	mutex_lock(&hive->hive_lock);
 
 	if (hive->pstate == pstate) {
-		mutex_unlock(&hive->hive_lock);
-		return 0;
+		adev->pstate = is_high_pstate ? pstate : adev->pstate;
+		goto out;
 	}
 
 	dev_dbg(adev->dev, "Set xgmi pstate %d.\n", pstate);
@@ -317,7 +318,7 @@ int amdgpu_xgmi_set_pstate(struct amdgpu_device *adev, int pstate)
 			break;
 		}
 	}
-	if (update_hive_pstate)
+	if (update_hive_pstate || is_high_pstate)
 		hive->pstate = pstate;
 
 out:
-- 
2.17.1

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

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

* RE: [PATCH] drm/amdgpu: fix vega20 pstate status change
@ 2019-11-07  4:03     ` Quan, Evan
  0 siblings, 0 replies; 4+ messages in thread
From: Quan, Evan @ 2019-11-07  4:03 UTC (permalink / raw)
  To: Kim, Jonathan, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
  Cc: Kuehling, Felix, Strawbridge, Michael

Reviewed-by: Evan Quan <evan.quan@amd.com>

> -----Original Message-----
> From: Kim, Jonathan <Jonathan.Kim@amd.com>
> Sent: Wednesday, November 6, 2019 10:04 PM
> To: amd-gfx@lists.freedesktop.org
> Cc: Kuehling, Felix <Felix.Kuehling@amd.com>; Quan, Evan
> <Evan.Quan@amd.com>; Strawbridge, Michael
> <Michael.Strawbridge@amd.com>; Kim, Jonathan <Jonathan.Kim@amd.com>;
> Kim, Jonathan <Jonathan.Kim@amd.com>
> Subject: [PATCH] drm/amdgpu: fix vega20 pstate status change
> 
> vega20 only requires all devices be set to same pstate level for low pstate and
> not high.
> 
> Change-Id: I399c84a47f6e24abca937ce950685c0c7f0e3279
> Signed-off-by: Jonathan Kim <Jonathan.Kim@amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c
> index de20a9a1c444..61d13d8b7b20 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c
> @@ -276,6 +276,7 @@ int amdgpu_xgmi_set_pstate(struct amdgpu_device
> *adev, int pstate)
>  	struct amdgpu_hive_info *hive = amdgpu_get_xgmi_hive(adev, 0);
>  	struct amdgpu_device *tmp_adev;
>  	bool update_hive_pstate = true;
> +	bool is_high_pstate = pstate && adev->asic_type == CHIP_VEGA20;
> 
>  	if (!hive)
>  		return 0;
> @@ -283,8 +284,8 @@ int amdgpu_xgmi_set_pstate(struct amdgpu_device
> *adev, int pstate)
>  	mutex_lock(&hive->hive_lock);
> 
>  	if (hive->pstate == pstate) {
> -		mutex_unlock(&hive->hive_lock);
> -		return 0;
> +		adev->pstate = is_high_pstate ? pstate : adev->pstate;
> +		goto out;
>  	}
> 
>  	dev_dbg(adev->dev, "Set xgmi pstate %d.\n", pstate); @@ -317,7
> +318,7 @@ int amdgpu_xgmi_set_pstate(struct amdgpu_device *adev, int
> pstate)
>  			break;
>  		}
>  	}
> -	if (update_hive_pstate)
> +	if (update_hive_pstate || is_high_pstate)
>  		hive->pstate = pstate;
> 
>  out:
> --
> 2.17.1

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

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

* RE: [PATCH] drm/amdgpu: fix vega20 pstate status change
@ 2019-11-07  4:03     ` Quan, Evan
  0 siblings, 0 replies; 4+ messages in thread
From: Quan, Evan @ 2019-11-07  4:03 UTC (permalink / raw)
  To: Kim, Jonathan, amd-gfx; +Cc: Kuehling, Felix, Strawbridge, Michael

Reviewed-by: Evan Quan <evan.quan@amd.com>

> -----Original Message-----
> From: Kim, Jonathan <Jonathan.Kim@amd.com>
> Sent: Wednesday, November 6, 2019 10:04 PM
> To: amd-gfx@lists.freedesktop.org
> Cc: Kuehling, Felix <Felix.Kuehling@amd.com>; Quan, Evan
> <Evan.Quan@amd.com>; Strawbridge, Michael
> <Michael.Strawbridge@amd.com>; Kim, Jonathan <Jonathan.Kim@amd.com>;
> Kim, Jonathan <Jonathan.Kim@amd.com>
> Subject: [PATCH] drm/amdgpu: fix vega20 pstate status change
> 
> vega20 only requires all devices be set to same pstate level for low pstate and
> not high.
> 
> Change-Id: I399c84a47f6e24abca937ce950685c0c7f0e3279
> Signed-off-by: Jonathan Kim <Jonathan.Kim@amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c
> index de20a9a1c444..61d13d8b7b20 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c
> @@ -276,6 +276,7 @@ int amdgpu_xgmi_set_pstate(struct amdgpu_device
> *adev, int pstate)
>  	struct amdgpu_hive_info *hive = amdgpu_get_xgmi_hive(adev, 0);
>  	struct amdgpu_device *tmp_adev;
>  	bool update_hive_pstate = true;
> +	bool is_high_pstate = pstate && adev->asic_type == CHIP_VEGA20;
> 
>  	if (!hive)
>  		return 0;
> @@ -283,8 +284,8 @@ int amdgpu_xgmi_set_pstate(struct amdgpu_device
> *adev, int pstate)
>  	mutex_lock(&hive->hive_lock);
> 
>  	if (hive->pstate == pstate) {
> -		mutex_unlock(&hive->hive_lock);
> -		return 0;
> +		adev->pstate = is_high_pstate ? pstate : adev->pstate;
> +		goto out;
>  	}
> 
>  	dev_dbg(adev->dev, "Set xgmi pstate %d.\n", pstate); @@ -317,7
> +318,7 @@ int amdgpu_xgmi_set_pstate(struct amdgpu_device *adev, int
> pstate)
>  			break;
>  		}
>  	}
> -	if (update_hive_pstate)
> +	if (update_hive_pstate || is_high_pstate)
>  		hive->pstate = pstate;
> 
>  out:
> --
> 2.17.1

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

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

end of thread, other threads:[~2019-11-07  4:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-06 14:04 [PATCH] drm/amdgpu: fix vega20 pstate status change Kim, Jonathan
2019-11-06 14:04 ` Kim, Jonathan
     [not found] ` <20191106140351.36350-1-jonathan.kim-5C7GfCeVMHo@public.gmane.org>
2019-11-07  4:03   ` Quan, Evan
2019-11-07  4:03     ` Quan, Evan

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.