AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amd/pm: Add waiting for response of mode-reset message for yellow carp
@ 2021-07-13  7:00 Aaron Liu
  2021-07-13  7:14 ` Quan, Evan
  2021-07-13  7:14 ` Huang Rui
  0 siblings, 2 replies; 3+ messages in thread
From: Aaron Liu @ 2021-07-13  7:00 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alexander.Deucher, Ray.Huang, Aaron Liu

Remove mdelay process and use smu_cmn_send_smc_msg_with_param to send
mode-reset message to SMC.

Signed-off-by: Aaron Liu <aaron.liu@amd.com>
---
 drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c
index de92f713a911..0cfeb9fc7c03 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c
@@ -298,13 +298,9 @@ static int yellow_carp_mode_reset(struct smu_context *smu, int type)
 	if (index < 0)
 		return index == -EACCES ? 0 : index;
 
-	mutex_lock(&smu->message_lock);
-
-	ret = smu_cmn_send_msg_without_waiting(smu, (uint16_t)index, type);
-
-	mutex_unlock(&smu->message_lock);
-
-	mdelay(10);
+	ret = smu_cmn_send_smc_msg_with_param(smu, (uint16_t)index, type, NULL);
+	if (ret)
+		dev_err(smu->adev->dev, "Failed to mode reset!\n");
 
 	return ret;
 }
-- 
2.25.1

_______________________________________________
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/pm: Add waiting for response of mode-reset message for yellow carp
  2021-07-13  7:00 [PATCH] drm/amd/pm: Add waiting for response of mode-reset message for yellow carp Aaron Liu
@ 2021-07-13  7:14 ` Quan, Evan
  2021-07-13  7:14 ` Huang Rui
  1 sibling, 0 replies; 3+ messages in thread
From: Quan, Evan @ 2021-07-13  7:14 UTC (permalink / raw)
  To: Liu, Aaron, amd-gfx@lists.freedesktop.org
  Cc: Deucher, Alexander, Huang, Ray, Liu, Aaron

[AMD Official Use Only]

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

> -----Original Message-----
> From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of
> Aaron Liu
> Sent: Tuesday, July 13, 2021 3:01 PM
> To: amd-gfx@lists.freedesktop.org
> Cc: Deucher, Alexander <Alexander.Deucher@amd.com>; Huang, Ray
> <Ray.Huang@amd.com>; Liu, Aaron <Aaron.Liu@amd.com>
> Subject: [PATCH] drm/amd/pm: Add waiting for response of mode-reset
> message for yellow carp
> 
> Remove mdelay process and use smu_cmn_send_smc_msg_with_param to
> send mode-reset message to SMC.
> 
> Signed-off-by: Aaron Liu <aaron.liu@amd.com>
> ---
>  drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c | 10 +++-------
>  1 file changed, 3 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c
> b/drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c
> index de92f713a911..0cfeb9fc7c03 100644
> --- a/drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c
> +++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c
> @@ -298,13 +298,9 @@ static int yellow_carp_mode_reset(struct
> smu_context *smu, int type)
>  	if (index < 0)
>  		return index == -EACCES ? 0 : index;
> 
> -	mutex_lock(&smu->message_lock);
> -
> -	ret = smu_cmn_send_msg_without_waiting(smu, (uint16_t)index,
> type);
> -
> -	mutex_unlock(&smu->message_lock);
> -
> -	mdelay(10);
> +	ret = smu_cmn_send_smc_msg_with_param(smu, (uint16_t)index,
> type, NULL);
> +	if (ret)
> +		dev_err(smu->adev->dev, "Failed to mode reset!\n");
> 
>  	return ret;
>  }
> --
> 2.25.1
> 
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.
> freedesktop.org%2Fmailman%2Flistinfo%2Famd-
> gfx&amp;data=04%7C01%7Cevan.quan%40amd.com%7C1045fee1435a4b49d
> 1ae08d945cc0427%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C63
> 7617564811709038%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMD
> AiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sdata=
> FSmq1fObJ5x2Yl86ZWsGpr7SZPju6o4CZYyPp2xBZOs%3D&amp;reserved=0
_______________________________________________
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

* Re: [PATCH] drm/amd/pm: Add waiting for response of mode-reset message for yellow carp
  2021-07-13  7:00 [PATCH] drm/amd/pm: Add waiting for response of mode-reset message for yellow carp Aaron Liu
  2021-07-13  7:14 ` Quan, Evan
@ 2021-07-13  7:14 ` Huang Rui
  1 sibling, 0 replies; 3+ messages in thread
From: Huang Rui @ 2021-07-13  7:14 UTC (permalink / raw)
  To: Liu, Aaron; +Cc: Deucher, Alexander, amd-gfx@lists.freedesktop.org

On Tue, Jul 13, 2021 at 03:00:57PM +0800, Liu, Aaron wrote:
> Remove mdelay process and use smu_cmn_send_smc_msg_with_param to send
> mode-reset message to SMC.
> 
> Signed-off-by: Aaron Liu <aaron.liu@amd.com>

Reviewed-by: Huang Rui <ray.huang@amd.com>

> ---
>  drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c | 10 +++-------
>  1 file changed, 3 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c
> index de92f713a911..0cfeb9fc7c03 100644
> --- a/drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c
> +++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c
> @@ -298,13 +298,9 @@ static int yellow_carp_mode_reset(struct smu_context *smu, int type)
>  	if (index < 0)
>  		return index == -EACCES ? 0 : index;
>  
> -	mutex_lock(&smu->message_lock);
> -
> -	ret = smu_cmn_send_msg_without_waiting(smu, (uint16_t)index, type);
> -
> -	mutex_unlock(&smu->message_lock);
> -
> -	mdelay(10);
> +	ret = smu_cmn_send_smc_msg_with_param(smu, (uint16_t)index, type, NULL);
> +	if (ret)
> +		dev_err(smu->adev->dev, "Failed to mode reset!\n");
>  
>  	return ret;
>  }
> -- 
> 2.25.1
> 
_______________________________________________
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:[~2021-07-13  7:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-07-13  7:00 [PATCH] drm/amd/pm: Add waiting for response of mode-reset message for yellow carp Aaron Liu
2021-07-13  7:14 ` Quan, Evan
2021-07-13  7:14 ` Huang Rui

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox