Skip to contentSkip to conversation

drm/amd/pm: skip the RLC stop when S0i3 suspend for SMU v13.0.4/11

PATCH In review Tim Huang 2 participants 5 messages Jul 28, 2023

Subsystems (3)
lore
Share & tools
lore

Tim Huang

author
#0 lore raw

PATCH 1/1 drm/amd/pm: skip the RLC stop when S0i3 suspend for SMU v13.0.4/11

From: Tim Huang <[email protected]>

For SMU v13.0.4/11, driver does not need to stop RLC for S0i3, the firmwares will handle that properly.

---
 drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +2 -2
index ce41a8309582..222af2fae745 100644
@@ -1581,9 +1581,9 @@ static int smu_disable_dpms(struct smu_context *smu)
 
 	/*
 	 * For SMU 13.0.4/11, PMFW will handle the features disablement properly
-	 * for gpu reset case. Driver involvement is unnecessary.
+	 * for gpu reset and S0i3 cases. Driver involvement is unnecessary.
 	 */
-	if (amdgpu_in_reset(adev)) {
+	if (amdgpu_in_reset(adev) || adev->in_s0ix) {
 		switch (adev->ip_versions[MP1_HWIP][0]) {
 		case IP_VERSION(13, 0, 4):
 		case IP_VERSION(13, 0, 11):
Signature · 1 line
2.34.1
#1 lore raw
Quoted 4 lines · Tim Huang

From: Tim Huang <[email protected]>

For SMU v13.0.4/11, driver does not need to stop RLC for S0i3, the firmwares will handle that properly.

Conceptually I'm aligned to this.
But, just to confirm, have you already run some testing with this with current GPU F/W, BIOS and either 6.1.y, 6.4.y or ASDN?

I checked with this on my side and saw success but I'm fearful that it introduces some of the fence expiration problems we had in the past and I'm just not seeing them for some reason.

Quoted 22 lines
---
  drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +2 -2
index ce41a8309582..222af2fae745 100644
@@ -1581,9 +1581,9 @@ static int smu_disable_dpms(struct smu_context *smu)
 
  	/*
  	 * For SMU 13.0.4/11, PMFW will handle the features disablement properly
-	 * for gpu reset case. Driver involvement is unnecessary.
+	 * for gpu reset and S0i3 cases. Driver involvement is unnecessary.
  	 */
-	if (amdgpu_in_reset(adev)) {
+	if (amdgpu_in_reset(adev) || adev->in_s0ix) {
  		switch (adev->ip_versions[MP1_HWIP][0]) {
  		case IP_VERSION(13, 0, 4):
  		case IP_VERSION(13, 0, 11):
author
#2 lore raw

[AMD Official Use Only - General]

From: Limonciello, Mario <[email protected]>
Sent: Friday, July 28, 2023 9:14 AM
To: Huang, Tim <[email protected]>; [email protected] <[email protected]>
Cc: Deucher, Alexander <[email protected]>; Zhang, Yifan <[email protected]>
Subject: Re: [PATCH] drm/amd/pm: skip the RLC stop when S0i3 suspend for SMU v13.0.4/11

Quoted 11 lines · Tim Huang

From: Tim Huang <[email protected]>

For SMU v13.0.4/11, driver does not need to stop RLC for S0i3, the firmwares will handle that properly.
Conceptually I'm aligned to this.
But, just to confirm, have you already run some testing with this with current GPU F/W, BIOS and either 6.1.y, 6.4.y or ASDN?

I checked with this on my side and saw success but I'm fearful that it introduces some of the fence expiration problems we had in the past and I'm just not seeing them for some reason.

Yes, verified based on current BIOS and latest drm-next kernel and the working FWs as the latest FWs may have some new issues.

For this patch, it is asked by the FW guys, driver should not touch RLC_CNTL in S0i3, let RLC FW to do that. If driver programs RLC_CNTL to halt RLC, RLC cannot go GFXOFF exit sequence.

The fence expiration should be still there by the delayed GFXOFF , but this patch should be useful to help debug it as it avoids the system hang when the issue happens.

Best Regards,
Tim

Quoted 22 lines
---
  drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +2 -2
index ce41a8309582..222af2fae745 100644
@@ -1581,9 +1581,9 @@ static int smu_disable_dpms(struct smu_context *smu)
 
       /*
        * For SMU 13.0.4/11, PMFW will handle the features disablement properly
-      * for gpu reset case. Driver involvement is unnecessary.
+      * for gpu reset and S0i3 cases. Driver involvement is unnecessary.
        */
-     if (amdgpu_in_reset(adev)) {
+     if (amdgpu_in_reset(adev) || adev->in_s0ix) {
               switch (adev->ip_versions[MP1_HWIP][0]) {
               case IP_VERSION(13, 0, 4):
               case IP_VERSION(13, 0, 11):
Reviewed-by
#3 lore raw
Quoted 22 lines · Tim

[AMD Official Use Only - General]

*From:* Limonciello, Mario <[email protected]>
*Sent:* Friday, July 28, 2023 9:14 AM
*To:* Huang, Tim <[email protected]>; [email protected] <[email protected]> *Cc:* Deucher, Alexander <[email protected]>; Zhang, Yifan <[email protected]> *Subject:* Re: [PATCH] drm/amd/pm: skip the RLC stop when S0i3 suspend for SMU v13.0.4/11

Quoted 11 lines · Tim Huang

From: Tim Huang <[email protected]>

For SMU v13.0.4/11, driver does not need to stop RLC for S0i3, the firmwares will handle that properly.
 Conceptually I'm aligned to this.
 But, just to confirm, have you already run some testing with this with current GPU F/W, BIOS and either 6.1.y, 6.4.y or ASDN?

I checked with this on my side and saw success but I'm fearful that it introduces some of the fence expiration problems we had in the past and I'm just not seeing them for some reason.

Quoted 5 lines

Yes, verified based on current BIOS and latest drm-next kernel and the working FWs as the latest FWs
may have some new issues.
For this patch, it is asked by the FW guys, driver should not touch RLC_CNTL in S0i3, let RLC FW to do that. If driver programs RLC_CNTL to halt RLC, RLC cannot go GFXOFF exit sequence.

The fence expiration should be still there by the delayed GFXOFF , but this patch should be useful to help debug it as it avoids the system hang when the issue happens.

So in that case you think that when the driver programs RLC_CNTL but GFXOFF was delayed sequence was going out of order and it triggered system hang. But now with this patch it will not hang but fences expire.

It makes sense to me. This patch shouldn't be any "more" harmful then.

For the delayed GFXOFF issue maybe we should revisit my previous idea for flushing GFXOFF requests. IIRC the most recent version was:

https://patchwork.freedesktop.org/patch/537888/?series=117965&rev=1

Quoted 27 lines

Best Regards,
Tim

Quoted 22 lines

---
   drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 4 ++--

   1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +2 -2
index ce41a8309582..222af2fae745 100644
@@ -1581,9 +1581,9 @@ static int smu_disable_dpms(struct smu_context *smu)
 
         /*
          * For SMU 13.0.4/11, PMFW will handle the features disablement properly
-      * for gpu reset case. Driver involvement is unnecessary.
+      * for gpu reset and S0i3 cases. Driver involvement is unnecessary.
          */
-     if (amdgpu_in_reset(adev)) {
+     if (amdgpu_in_reset(adev) || adev->in_s0ix) {
                 switch (adev->ip_versions[MP1_HWIP][0]) {

                case IP_VERSION(13, 0, 4):
                case IP_VERSION(13, 0, 11):

author
#4 lore raw

[AMD Official Use Only - General]

From: Limonciello, Mario <[email protected]>
Sent: Friday, July 28, 2023 10:39 AM
To: Huang, Tim <[email protected]>; [email protected] <[email protected]>
Cc: Deucher, Alexander <[email protected]>; Zhang, Yifan <[email protected]>
Subject: Re: [PATCH] drm/amd/pm: skip the RLC stop when S0i3 suspend for SMU v13.0.4/11

Quoted 40 lines · Tim

[AMD Official Use Only - General]

*From:* Limonciello, Mario <[email protected]> *Sent:* Friday, July 28, 2023 9:14 AM
*To:* Huang, Tim <[email protected]>; [email protected] <[email protected]>
*Cc:* Deucher, Alexander <[email protected]>; Zhang, Yifan <[email protected]>
*Subject:* Re: [PATCH] drm/amd/pm: skip the RLC stop when S0i3 suspend for SMU v13.0.4/11

Quoted 11 lines · Tim Huang

From: Tim Huang <[email protected]>

For SMU v13.0.4/11, driver does not need to stop RLC for S0i3, the firmwares will handle that properly.
Conceptually I'm aligned to this.
But, just to confirm, have you already run some testing with this with current GPU F/W, BIOS and either 6.1.y, 6.4.y or ASDN?

I checked with this on my side and saw success but I'm fearful that it introduces some of the fence expiration problems we had in the past and I'm just not seeing them for some reason.

Yes, verified based on current BIOS and latest drm-next kernel and the working FWs as the latest FWs
may have some new issues.
For this patch, it is asked by the FW guys, driver should not touch RLC_CNTL in S0i3, let RLC FW to do that. If driver programs RLC_CNTL to halt RLC, RLC cannot go GFXOFF exit sequence.

The fence expiration should be still there by the delayed GFXOFF , but this patch should be useful to help debug it as it avoids the system hang when the issue happens.

So in that case you think that when the driver programs RLC_CNTL but GFXOFF was delayed sequence was going out of order and it triggered system hang. But now with this patch it will not hang but fences expire.

Quoted 8 lines

It makes sense to me. This patch shouldn't be any "more" harmful then.

For the delayed GFXOFF issue maybe we should revisit my previous idea for flushing GFXOFF requests. IIRC the most recent version was:

https://patchwork.freedesktop.org/patch/537888/?series=117965&rev=1

I agree. We can add this patch to the latest test build and check whether the issue is gone.

Thanks.

Quoted 27 lines

Best Regards,
Tim

Quoted 22 lines
---
  drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +2 -2
index ce41a8309582..222af2fae745 100644
@@ -1581,9 +1581,9 @@ static int smu_disable_dpms(struct smu_context *smu)
 
       /*
        * For SMU 13.0.4/11, PMFW will handle the features disablement properly
-      * for gpu reset case. Driver involvement is unnecessary.
+      * for gpu reset and S0i3 cases. Driver involvement is unnecessary.
        */
-     if (amdgpu_in_reset(adev)) {
+     if (amdgpu_in_reset(adev) || adev->in_s0ix) {
               switch (adev->ip_versions[MP1_HWIP][0]) {
               case IP_VERSION(13, 0, 4):
               case IP_VERSION(13, 0, 11):