* [PATCH 2/2] drm/amd/pm: check specific index for aldebaran
@ 2024-05-14 6:04 Jesse Zhang
2024-05-14 6:06 ` Lazar, Lijo
0 siblings, 1 reply; 5+ messages in thread
From: Jesse Zhang @ 2024-05-14 6:04 UTC (permalink / raw)
To: amd-gfx
Cc: Alexander.Deucher, Christian Koenig, Tim.Huang, Jesse Zhang,
Lijo Lazar
To avoid warning problems, drop index and
use PPSMC_MSG_GfxDriverReset instead of index for aldebaran.
Signed-off-by: Jesse Zhang <jesse.zhang@amd.com>
Suggested-by: Lijo Lazar <lijo.lazar@amd.com>
---
drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c
index a22eb6bbb05e..d671314c46c8 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c
@@ -1880,17 +1880,18 @@ static int aldebaran_mode1_reset(struct smu_context *smu)
static int aldebaran_mode2_reset(struct smu_context *smu)
{
- int ret = 0, index;
+ int ret = 0;
struct amdgpu_device *adev = smu->adev;
int timeout = 10;
- index = smu_cmn_to_asic_specific_index(smu, CMN2ASIC_MAPPING_MSG,
- SMU_MSG_GfxDeviceDriverReset);
- if (index < 0 )
- return -EINVAL;
mutex_lock(&smu->message_lock);
if (smu->smc_fw_version >= 0x00441400) {
- ret = smu_cmn_send_msg_without_waiting(smu, (uint16_t)index, SMU_RESET_MODE_2);
+ ret = smu_cmn_send_smc_msg_with_param(smu, SMU_MSG_GfxDeviceDriverReset,
+ SMU_RESET_MODE_2, NULL);
+ if (ret) {
+ dev_err(smu->adev->dev, "Failed to mode2 reset!\n");
+ goto out;
+ }
/* This is similar to FLR, wait till max FLR timeout */
msleep(100);
dev_dbg(smu->adev->dev, "restore config space...\n");
--
2.25.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] drm/amd/pm: check specific index for aldebaran
2024-05-14 6:04 [PATCH 2/2] drm/amd/pm: check specific index for aldebaran Jesse Zhang
@ 2024-05-14 6:06 ` Lazar, Lijo
2024-05-14 7:07 ` Wang, Yang(Kevin)
0 siblings, 1 reply; 5+ messages in thread
From: Lazar, Lijo @ 2024-05-14 6:06 UTC (permalink / raw)
To: Jesse Zhang, amd-gfx; +Cc: Alexander.Deucher, Christian Koenig, Tim.Huang
On 5/14/2024 11:34 AM, Jesse Zhang wrote:
> To avoid warning problems, drop index and
> use PPSMC_MSG_GfxDriverReset instead of index for aldebaran.
>
> Signed-off-by: Jesse Zhang <jesse.zhang@amd.com>
> Suggested-by: Lijo Lazar <lijo.lazar@amd.com>
> ---
> drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c | 13 +++++++------
> 1 file changed, 7 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c
> index a22eb6bbb05e..d671314c46c8 100644
> --- a/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c
> +++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c
> @@ -1880,17 +1880,18 @@ static int aldebaran_mode1_reset(struct smu_context *smu)
>
> static int aldebaran_mode2_reset(struct smu_context *smu)
> {
> - int ret = 0, index;
> + int ret = 0;
> struct amdgpu_device *adev = smu->adev;
> int timeout = 10;
>
> - index = smu_cmn_to_asic_specific_index(smu, CMN2ASIC_MAPPING_MSG,
> - SMU_MSG_GfxDeviceDriverReset);
> - if (index < 0 )
> - return -EINVAL;
> mutex_lock(&smu->message_lock);
> if (smu->smc_fw_version >= 0x00441400) {
> - ret = smu_cmn_send_msg_without_waiting(smu, (uint16_t)index, SMU_RESET_MODE_2);
> + ret = smu_cmn_send_smc_msg_with_param(smu, SMU_MSG_GfxDeviceDriverReset,
PPSMC_MSG_GfxDriverReset is different from SMU_MSG_GfxDeviceDriverReset.
Use PPSMC_MSG_GfxDriverReset here (for both patches).
Thanks,
Lijo
> + SMU_RESET_MODE_2, NULL);
> + if (ret) {
> + dev_err(smu->adev->dev, "Failed to mode2 reset!\n");
> + goto out;
> + }
> /* This is similar to FLR, wait till max FLR timeout */
> msleep(100);
> dev_dbg(smu->adev->dev, "restore config space...\n");
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [PATCH 2/2] drm/amd/pm: check specific index for aldebaran
2024-05-14 6:06 ` Lazar, Lijo
@ 2024-05-14 7:07 ` Wang, Yang(Kevin)
2024-05-14 7:14 ` Lazar, Lijo
0 siblings, 1 reply; 5+ messages in thread
From: Wang, Yang(Kevin) @ 2024-05-14 7:07 UTC (permalink / raw)
To: Lazar, Lijo, Zhang, Jesse(Jie), amd-gfx@lists.freedesktop.org
Cc: Deucher, Alexander, Koenig, Christian, Huang, Tim
[AMD Official Use Only - AMD Internal Distribution Only]
-----Original Message-----
From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Lazar, Lijo
Sent: Tuesday, May 14, 2024 2:07 PM
To: Zhang, Jesse(Jie) <Jesse.Zhang@amd.com>; amd-gfx@lists.freedesktop.org
Cc: Deucher, Alexander <Alexander.Deucher@amd.com>; Koenig, Christian <Christian.Koenig@amd.com>; Huang, Tim <Tim.Huang@amd.com>
Subject: Re: [PATCH 2/2] drm/amd/pm: check specific index for aldebaran
On 5/14/2024 11:34 AM, Jesse Zhang wrote:
> To avoid warning problems, drop index and use PPSMC_MSG_GfxDriverReset
> instead of index for aldebaran.
>
> Signed-off-by: Jesse Zhang <jesse.zhang@amd.com>
> Suggested-by: Lijo Lazar <lijo.lazar@amd.com>
> ---
> drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c | 13 +++++++------
> 1 file changed, 7 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c
> b/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c
> index a22eb6bbb05e..d671314c46c8 100644
> --- a/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c
> +++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c
> @@ -1880,17 +1880,18 @@ static int aldebaran_mode1_reset(struct
> smu_context *smu)
>
> static int aldebaran_mode2_reset(struct smu_context *smu) {
> - int ret = 0, index;
> + int ret = 0;
> struct amdgpu_device *adev = smu->adev;
> int timeout = 10;
>
> - index = smu_cmn_to_asic_specific_index(smu, CMN2ASIC_MAPPING_MSG,
> - SMU_MSG_GfxDeviceDriverReset);
> - if (index < 0 )
> - return -EINVAL;
> mutex_lock(&smu->message_lock);
> if (smu->smc_fw_version >= 0x00441400) {
> - ret = smu_cmn_send_msg_without_waiting(smu, (uint16_t)index, SMU_RESET_MODE_2);
> + ret = smu_cmn_send_smc_msg_with_param(smu,
> +SMU_MSG_GfxDeviceDriverReset,
PPSMC_MSG_GfxDriverReset is different from SMU_MSG_GfxDeviceDriverReset.
Use PPSMC_MSG_GfxDriverReset here (for both patches).
Thanks,
Lijo
[Kevin]:
There is no interface here to directly use PPSMC_MSG_XXX to send messages to smu/pmfw in the swSMU driver,
and it is not recommended to do so to maintain code consistency.
Best Regards,
Kevin
> + SMU_RESET_MODE_2, NULL);
> + if (ret) {
> + dev_err(smu->adev->dev, "Failed to mode2 reset!\n");
> + goto out;
> + }
> /* This is similar to FLR, wait till max FLR timeout */
> msleep(100);
> dev_dbg(smu->adev->dev, "restore config space...\n");
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] drm/amd/pm: check specific index for aldebaran
2024-05-14 7:07 ` Wang, Yang(Kevin)
@ 2024-05-14 7:14 ` Lazar, Lijo
0 siblings, 0 replies; 5+ messages in thread
From: Lazar, Lijo @ 2024-05-14 7:14 UTC (permalink / raw)
To: Wang, Yang(Kevin), Zhang, Jesse(Jie),
amd-gfx@lists.freedesktop.org
Cc: Deucher, Alexander, Koenig, Christian, Huang, Tim
On 5/14/2024 12:37 PM, Wang, Yang(Kevin) wrote:
> [AMD Official Use Only - AMD Internal Distribution Only]
>
> -----Original Message-----
> From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Lazar, Lijo
> Sent: Tuesday, May 14, 2024 2:07 PM
> To: Zhang, Jesse(Jie) <Jesse.Zhang@amd.com>; amd-gfx@lists.freedesktop.org
> Cc: Deucher, Alexander <Alexander.Deucher@amd.com>; Koenig, Christian <Christian.Koenig@amd.com>; Huang, Tim <Tim.Huang@amd.com>
> Subject: Re: [PATCH 2/2] drm/amd/pm: check specific index for aldebaran
>
>
>
> On 5/14/2024 11:34 AM, Jesse Zhang wrote:
>> To avoid warning problems, drop index and use PPSMC_MSG_GfxDriverReset
>> instead of index for aldebaran.
>>
>> Signed-off-by: Jesse Zhang <jesse.zhang@amd.com>
>> Suggested-by: Lijo Lazar <lijo.lazar@amd.com>
>> ---
>> drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c | 13 +++++++------
>> 1 file changed, 7 insertions(+), 6 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c
>> b/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c
>> index a22eb6bbb05e..d671314c46c8 100644
>> --- a/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c
>> +++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c
>> @@ -1880,17 +1880,18 @@ static int aldebaran_mode1_reset(struct
>> smu_context *smu)
>>
>> static int aldebaran_mode2_reset(struct smu_context *smu) {
>> - int ret = 0, index;
>> + int ret = 0;
>> struct amdgpu_device *adev = smu->adev;
>> int timeout = 10;
>>
>> - index = smu_cmn_to_asic_specific_index(smu, CMN2ASIC_MAPPING_MSG,
>> - SMU_MSG_GfxDeviceDriverReset);
>> - if (index < 0 )
>> - return -EINVAL;
>> mutex_lock(&smu->message_lock);
>> if (smu->smc_fw_version >= 0x00441400) {
>> - ret = smu_cmn_send_msg_without_waiting(smu, (uint16_t)index, SMU_RESET_MODE_2);
>> + ret = smu_cmn_send_smc_msg_with_param(smu,
>> +SMU_MSG_GfxDeviceDriverReset,
>
> PPSMC_MSG_GfxDriverReset is different from SMU_MSG_GfxDeviceDriverReset.
> Use PPSMC_MSG_GfxDriverReset here (for both patches).
>
> Thanks,
> Lijo
>
> [Kevin]:
>
> There is no interface here to directly use PPSMC_MSG_XXX to send messages to smu/pmfw in the swSMU driver,
> and it is not recommended to do so to maintain code consistency.
>
Thanks, didn't notice earlier that smu_cmn_send_msg_without_waiting got
changed as well with this patch. This API is a direct interface.
Please note not to change anything else other than what is specifically
requested in review comment. The original comment was only to replace
index with PPSMC_MSG_GfxDriverReset. Please stick to that, otherwise it
will break the entire sequence.
Thanks,
Lijo
> Best Regards,
> Kevin
>
>> + SMU_RESET_MODE_2, NULL);
>> + if (ret) {
>> + dev_err(smu->adev->dev, "Failed to mode2 reset!\n");
>> + goto out;
>> + }
>> /* This is similar to FLR, wait till max FLR timeout */
>> msleep(100);
>> dev_dbg(smu->adev->dev, "restore config space...\n");
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 2/2] drm/amd/pm: check specific index for aldebaran
@ 2024-05-14 9:06 Jesse Zhang
0 siblings, 0 replies; 5+ messages in thread
From: Jesse Zhang @ 2024-05-14 9:06 UTC (permalink / raw)
To: amd-gfx
Cc: Alexander.Deucher, Christian Koenig, Tim.Huang, Jesse Zhang,
Lijo Lazar
To avoid warning problems, drop index and
use PPSMC_MSG_GfxDriverReset instead of index for aldebaran.
Signed-off-by: Jesse Zhang <jesse.zhang@amd.com>
Suggested-by: Lijo Lazar <lijo.lazar@amd.com>
---
drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c
index a22eb6bbb05e..2fc4ba036afe 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c
@@ -1880,17 +1880,18 @@ static int aldebaran_mode1_reset(struct smu_context *smu)
static int aldebaran_mode2_reset(struct smu_context *smu)
{
- int ret = 0, index;
+ int ret = 0;
struct amdgpu_device *adev = smu->adev;
int timeout = 10;
- index = smu_cmn_to_asic_specific_index(smu, CMN2ASIC_MAPPING_MSG,
- SMU_MSG_GfxDeviceDriverReset);
- if (index < 0 )
- return -EINVAL;
mutex_lock(&smu->message_lock);
if (smu->smc_fw_version >= 0x00441400) {
- ret = smu_cmn_send_msg_without_waiting(smu, (uint16_t)index, SMU_RESET_MODE_2);
+ ret = smu_cmn_send_msg_without_waiting(smu, PPSMC_MSG_GfxDriverReset,
+ SMU_RESET_MODE_2);
+ if (ret) {
+ dev_err(smu->adev->dev, "Failed to mode2 reset!\n");
+ goto out;
+ }
/* This is similar to FLR, wait till max FLR timeout */
msleep(100);
dev_dbg(smu->adev->dev, "restore config space...\n");
--
2.25.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-05-14 9:06 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-14 6:04 [PATCH 2/2] drm/amd/pm: check specific index for aldebaran Jesse Zhang
2024-05-14 6:06 ` Lazar, Lijo
2024-05-14 7:07 ` Wang, Yang(Kevin)
2024-05-14 7:14 ` Lazar, Lijo
-- strict thread matches above, loose matches on Subject: below --
2024-05-14 9:06 Jesse Zhang
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.