RE: [PATCH] drm/amd/pm: Enable smu v13_0_6 eccinfo in firmware query mode

2024-01-09 Thread Li, Candice
[AMD Official Use Only - General]

I agree.



Thanks,
Candice

-Original Message-
From: Zhang, Hawking 
Sent: Wednesday, January 10, 2024 10:48 AM
To: Li, Candice ; amd-gfx@lists.freedesktop.org
Cc: Li, Candice 
Subject: RE: [PATCH] drm/amd/pm: Enable smu v13_0_6 eccinfo in firmware query 
mode

[AMD Official Use Only - General]

Let' s see if we can retire the get_ecc_info callback since from smu_v13. 
(i.e., do not provide the callback implementation). What we just need to ensure 
the driver can fallback to direct poll mode when aca debug mode is enabled, 
this applies to both error query and bad page retirement.

Thoughts?

Regards,
Hawking

-Original Message-
From: amd-gfx  On Behalf Of Candice Li
Sent: Wednesday, January 10, 2024 10:26
To: amd-gfx@lists.freedesktop.org
Cc: Li, Candice 
Subject: [PATCH] drm/amd/pm: Enable smu v13_0_6 eccinfo in firmware query mode

smu v13_0_6 eccinfo is supported in firmware query mode only.

Signed-off-by: Candice Li 
---
 drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c 
b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c
index 4ebc6b421c2cb4..29396424a99609 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c
@@ -2896,8 +2896,11 @@ static int smu_v13_0_6_select_xgmi_plpd_policy(struct 
smu_context *smu,  static ssize_t smu_v13_0_6_get_ecc_info(struct smu_context 
*smu,
void *table)
 {
-   /* Support ecc info by default */
-   return 0;
+   struct amdgpu_device *adev = smu->adev;
+   unsigned int error_query_mode;
+
+   return (amdgpu_ras_get_error_query_mode(adev, _query_mode) &&
+   error_query_mode == AMDGPU_RAS_FIRMWARE_ERROR_QUERY) ? 0 :
+-EOPNOTSUPP;
 }

 static const struct pptable_funcs smu_v13_0_6_ppt_funcs = {
--
2.25.1




RE: [PATCH] drm/amd/pm: Enable smu v13_0_6 eccinfo in firmware query mode

2024-01-09 Thread Zhang, Hawking
[AMD Official Use Only - General]

Let' s see if we can retire the get_ecc_info callback since from smu_v13. 
(i.e., do not provide the callback implementation). What we just need to ensure 
the driver can fallback to direct poll mode when aca debug mode is enabled, 
this applies to both error query and bad page retirement.

Thoughts?

Regards,
Hawking

-Original Message-
From: amd-gfx  On Behalf Of Candice Li
Sent: Wednesday, January 10, 2024 10:26
To: amd-gfx@lists.freedesktop.org
Cc: Li, Candice 
Subject: [PATCH] drm/amd/pm: Enable smu v13_0_6 eccinfo in firmware query mode

smu v13_0_6 eccinfo is supported in firmware query mode only.

Signed-off-by: Candice Li 
---
 drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c 
b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c
index 4ebc6b421c2cb4..29396424a99609 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c
@@ -2896,8 +2896,11 @@ static int smu_v13_0_6_select_xgmi_plpd_policy(struct 
smu_context *smu,  static ssize_t smu_v13_0_6_get_ecc_info(struct smu_context 
*smu,
void *table)
 {
-   /* Support ecc info by default */
-   return 0;
+   struct amdgpu_device *adev = smu->adev;
+   unsigned int error_query_mode;
+
+   return (amdgpu_ras_get_error_query_mode(adev, _query_mode) &&
+   error_query_mode == AMDGPU_RAS_FIRMWARE_ERROR_QUERY) ? 0 :
+-EOPNOTSUPP;
 }

 static const struct pptable_funcs smu_v13_0_6_ppt_funcs = {
--
2.25.1



RE: [PATCH] drm/amd/pm: Enable smu v13_0_6 eccinfo in firmware query mode

2024-01-09 Thread Li, Candice
[AMD Official Use Only - General]

Sorry, please ignore the patch.



Thanks,
Candice

-Original Message-
From: Li, Candice 
Sent: Wednesday, January 10, 2024 10:11 AM
To: amd-gfx@lists.freedesktop.org
Cc: Li, Candice 
Subject: [PATCH] drm/amd/pm: Enable smu v13_0_6 eccinfo in firmware query mode

smu v13_0_6 eccinfo is supported in firmware query mode only.

Signed-off-by: Candice Li 
---
 drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c 
b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c
index 4ebc6b421c2cb4..8f78294e4a6195 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c
@@ -2896,8 +2896,11 @@ static int smu_v13_0_6_select_xgmi_plpd_policy(struct 
smu_context *smu,
 static ssize_t smu_v13_0_6_get_ecc_info(struct smu_context *smu,
void *table)
 {
-   /* Support ecc info by default */
-   return 0;
+   struct amdgpu_device *adev = smu->adev;
+   unsigned int error_query_mode;
+
+   return (amdgpu_ras_get_error_query_mode(adev, _query_mode) &&
+   error_query_mode == AMDGPU_RAS_FIRMWARE_ERROR_QUERY);
 }

 static const struct pptable_funcs smu_v13_0_6_ppt_funcs = {
--
2.25.1