Skip to contentSkip to conversation

drm/amdgpu: disable runtime pm on several sienna cichlid cards(v2)

PATCH In review Guchun Chen 4 participants 5 messages Apr 27, 2022 – Apr 28, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: disable runtime pm on several sienna cichlid cards(v2)

Disable runtime power management on several sienna cichlid cards, otherwise SMU will possibly fail to be resumed from runtime suspend. Will drop this after a clean solution between kernel driver and SMU FW is available.

amdgpu 0000:63:00.0: amdgpu: GECC is enabled
amdgpu 0000:63:00.0: amdgpu: SECUREDISPLAY: securedisplay ta ucode is not available
amdgpu 0000:63:00.0: amdgpu: SMU is resuming...
amdgpu 0000:63:00.0: amdgpu: SMU: I'm not done with your command: SMN_C2PMSG_66:0x0000000E SMN_C2PMSG_82:0x00000080 amdgpu 0000:63:00.0: amdgpu: Failed to SetDriverDramAddr!
amdgpu 0000:63:00.0: amdgpu: Failed to setup smc hw!
[drm:amdgpu_device_ip_resume_phase2 [amdgpu]] *ERROR* resume of IP block <smu> failed -62
amdgpu 0000:63:00.0: amdgpu: amdgpu_device_ip_resume failed (-62)

v2: seperate to a function.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +14 -0
index 262938f0dfdb..1bf8ff71b6b5 100644
@@ -43,6 +43,17 @@
 #include "amdgpu_display.h"
 #include "amdgpu_ras.h"
 
+static void amdgpu_runtime_pm_quirk(struct amdgpu_device *adev)
+{
+	/*
+	 * Add below quirk on several sienna_cichlid cards to disable
+	 * runtime pm to fix EMI failures.
+	 */
+	if (((adev->pdev->device == 0x73A1) && (adev->pdev->revision == 0x00)) ||
+	    ((adev->pdev->device == 0x73BF) && (adev->pdev->revision == 0xCF)))
+		adev->runpm = false;
+}
+
 void amdgpu_unregister_gpu_instance(struct amdgpu_device *adev)
 {
 	struct amdgpu_gpu_instance *gpu_instance;
@@ -180,6 +191,9 @@ int amdgpu_driver_load_kms(struct amdgpu_device *adev, unsigned long flags)
 		 */
 		if (adev->is_fw_fb)
 			adev->runpm = false;
+
+		amdgpu_runtime_pm_quirk(adev);
+
 		if (adev->runpm)
 			dev_info(adev->dev, "Using BACO for runtime pm\n");
 	}
Signature · 1 line
2.17.1
#1 lore raw

[AMD Official Use Only - General]

Quoted 54 lines

-----Original Message-----
From: Chen, Guchun <[email protected]>
Sent: Wednesday, April 27, 2022 6:27 PM
To: [email protected]; Koenig, Christian <[email protected]>; Zhang, Hawking <[email protected]>; Deucher, Alexander <[email protected]>; Lazar, Lijo <[email protected]>; Quan, Evan <[email protected]>
Cc: Chen, Guchun <[email protected]>
Subject: [PATCH] drm/amdgpu: disable runtime pm on several sienna cichlid cards(v2)

Disable runtime power management on several sienna cichlid cards, otherwise SMU will possibly fail to be resumed from runtime suspend. Will drop this after a clean solution between kernel driver and SMU FW is available.

amdgpu 0000:63:00.0: amdgpu: GECC is enabled
amdgpu 0000:63:00.0: amdgpu: SECUREDISPLAY: securedisplay ta ucode is not available
amdgpu 0000:63:00.0: amdgpu: SMU is resuming...
amdgpu 0000:63:00.0: amdgpu: SMU: I'm not done with your command:
SMN_C2PMSG_66:0x0000000E SMN_C2PMSG_82:0x00000080
amdgpu 0000:63:00.0: amdgpu: Failed to SetDriverDramAddr! amdgpu 0000:63:00.0: amdgpu: Failed to setup smc hw! [drm:amdgpu_device_ip_resume_phase2 [amdgpu]] *ERROR* resume of IP block <smu> failed -62
amdgpu 0000:63:00.0: amdgpu: amdgpu_device_ip_resume failed (-62)

v2: seperate to a function.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +7 -0
index 262938f0dfdb..1bf8ff71b6b5 100644
@@ -43,6 +43,17 @@
 #include "amdgpu_display.h"
 #include "amdgpu_ras.h"
 
+static void amdgpu_runtime_pm_quirk(struct amdgpu_device *adev)
+{
+	/*
+	 * Add below quirk on several sienna_cichlid cards to disable
+	 * runtime pm to fix EMI failures.
+	 */
+	if (((adev->pdev->device == 0x73A1) && (adev->pdev->revision ==

0x00)) ||

drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +1 -0
+	    ((adev->pdev->device == 0x73BF) && (adev->pdev->revision ==

0xCF)))

drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c line 56

Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +3 -0
+		adev->runpm = false;
+}
+

[Quan, Evan] Better to move this to sienna_cichlid_check_bxco_support(). As long as smu_baco->platform_support is set as false there, the runpm will be disabled accordingly I think.

Either way the patch is reviewed-by: Evan Quan <[email protected]>

BR
Evan

Quoted 17 lines

void amdgpu_unregister_gpu_instance(struct amdgpu_device *adev) {

drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +3 -0
 	struct amdgpu_gpu_instance *gpu_instance;
@@ -180,6 +191,9 @@ int amdgpu_driver_load_kms(struct amdgpu_device
 *adev, unsigned long flags)
 		 */
 		if (adev->is_fw_fb)
 			adev->runpm = false;
+
+		amdgpu_runtime_pm_quirk(adev);
+
 		if (adev->runpm)
 			dev_info(adev->dev, "Using BACO for runtime

pm\n");
}
--
2.17.1

#2 lore raw
Quoted 49 lines · Evan

[AMD Official Use Only - General]

Quoted 44 lines

-----Original Message-----
From: Chen, Guchun <[email protected]>
Sent: Wednesday, April 27, 2022 6:27 PM
To: [email protected]; Koenig, Christian <[email protected]>; Zhang, Hawking <[email protected]>; Deucher, Alexander <[email protected]>; Lazar, Lijo <[email protected]>; Quan, Evan <[email protected]>
Cc: Chen, Guchun <[email protected]>
Subject: [PATCH] drm/amdgpu: disable runtime pm on several sienna cichlid cards(v2)

Disable runtime power management on several sienna cichlid cards, otherwise SMU will possibly fail to be resumed from runtime suspend. Will drop this after a clean solution between kernel driver and SMU FW is available.

amdgpu 0000:63:00.0: amdgpu: GECC is enabled
amdgpu 0000:63:00.0: amdgpu: SECUREDISPLAY: securedisplay ta ucode is not available
amdgpu 0000:63:00.0: amdgpu: SMU is resuming...
amdgpu 0000:63:00.0: amdgpu: SMU: I'm not done with your command:
SMN_C2PMSG_66:0x0000000E SMN_C2PMSG_82:0x00000080
amdgpu 0000:63:00.0: amdgpu: Failed to SetDriverDramAddr! amdgpu 0000:63:00.0: amdgpu: Failed to setup smc hw! [drm:amdgpu_device_ip_resume_phase2 [amdgpu]] *ERROR* resume of IP block <smu> failed -62
amdgpu 0000:63:00.0: amdgpu: amdgpu_device_ip_resume failed (-62)

v2: seperate to a function.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +0 -0
index 262938f0dfdb..1bf8ff71b6b5 100644
@@ -43,6 +43,17 @@
 #include "amdgpu_display.h"
 #include "amdgpu_ras.h"
 
Quoted 15 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c line 56

Quoted 13 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +7 -0
+static void amdgpu_runtime_pm_quirk(struct amdgpu_device *adev)
+{
+     /*
+      * Add below quirk on several sienna_cichlid cards to disable
+      * runtime pm to fix EMI failures.
+      */
+     if (((adev->pdev->device == 0x73A1) && (adev->pdev->revision ==

0x00)) ||
+ ((adev->pdev->device == 0x73BF) && (adev->pdev->revision ==
0xCF)))

drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +3 -0
+             adev->runpm = false;
+}
+

[Quan, Evan] Better to move this to sienna_cichlid_check_bxco_support(). As long as smu_baco->platform_support is set as false there, the runpm will be disabled accordingly I think.

Good point. We probably want to disable BACO entirely or enable the workaround because BACO could also be used for a GPU reset in some cases. Then only disable runtime pm if BACO will be used. BOCO should still work fine for example.

Alex

Quoted 22 lines

Either way the patch is reviewed-by: Evan Quan <[email protected]>

BR
Evan

Quoted 17 lines

void amdgpu_unregister_gpu_instance(struct amdgpu_device *adev)

 {
      struct amdgpu_gpu_instance *gpu_instance;
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +3 -0
@@ -180,6 +191,9 @@ int amdgpu_driver_load_kms(struct amdgpu_device
 *adev, unsigned long flags)
               */
              if (adev->is_fw_fb)
                      adev->runpm = false;
+
+             amdgpu_runtime_pm_quirk(adev);
+
              if (adev->runpm)
                      dev_info(adev->dev, "Using BACO for runtime
pm\n");
      }

--
2.17.1

#3 lore raw
Quoted 66 lines · Alex Deucher
Quoted 49 lines · Evan

[AMD Official Use Only - General]

Quoted 44 lines

-----Original Message-----
From: Chen, Guchun <[email protected]>
Sent: Wednesday, April 27, 2022 6:27 PM
To: [email protected]; Koenig, Christian <[email protected]>; Zhang, Hawking <[email protected]>; Deucher, Alexander <[email protected]>; Lazar, Lijo <[email protected]>; Quan, Evan <[email protected]>
Cc: Chen, Guchun <[email protected]>
Subject: [PATCH] drm/amdgpu: disable runtime pm on several sienna cichlid cards(v2)

Disable runtime power management on several sienna cichlid cards, otherwise SMU will possibly fail to be resumed from runtime suspend. Will drop this after a clean solution between kernel driver and SMU FW is available.

amdgpu 0000:63:00.0: amdgpu: GECC is enabled
amdgpu 0000:63:00.0: amdgpu: SECUREDISPLAY: securedisplay ta ucode is not available
amdgpu 0000:63:00.0: amdgpu: SMU is resuming...
amdgpu 0000:63:00.0: amdgpu: SMU: I'm not done with your command:
SMN_C2PMSG_66:0x0000000E SMN_C2PMSG_82:0x00000080
amdgpu 0000:63:00.0: amdgpu: Failed to SetDriverDramAddr! amdgpu 0000:63:00.0: amdgpu: Failed to setup smc hw! [drm:amdgpu_device_ip_resume_phase2 [amdgpu]] *ERROR* resume of IP block <smu> failed -62
amdgpu 0000:63:00.0: amdgpu: amdgpu_device_ip_resume failed (-62)

v2: seperate to a function.

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 14 ++++++++++++++
  1 file changed, 14 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +0 -0
index 262938f0dfdb..1bf8ff71b6b5 100644
@@ -43,6 +43,17 @@
  #include "amdgpu_display.h"
  #include "amdgpu_ras.h"
 
Quoted 15 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c line 56

Quoted 13 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +7 -0
+static void amdgpu_runtime_pm_quirk(struct amdgpu_device *adev)
+{
+     /*
+      * Add below quirk on several sienna_cichlid cards to disable
+      * runtime pm to fix EMI failures.
+      */
+     if (((adev->pdev->device == 0x73A1) && (adev->pdev->revision ==

0x00)) ||
+ ((adev->pdev->device == 0x73BF) && (adev->pdev->revision ==
0xCF)))

drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +3 -0
+             adev->runpm = false;
+}
+

[Quan, Evan] Better to move this to sienna_cichlid_check_bxco_support(). As long as smu_baco->platform_support is set as false there, the runpm will be disabled accordingly I think.

Quoted 5 lines

Good point. We probably want to disable BACO entirely or enable the workaround because BACO could also be used for a GPU reset in some cases. Then only disable runtime pm if BACO will be used. BOCO should still work fine for example.

As far as I remember, the WA proposal still wants to retain BACO as a reset method.

Thanks,
Lijo

Quoted 24 lines

Alex

Quoted 22 lines

Either way the patch is reviewed-by: Evan Quan <[email protected]>

BR
Evan

Quoted 17 lines
  void amdgpu_unregister_gpu_instance(struct amdgpu_device *adev)
  {
       struct amdgpu_gpu_instance *gpu_instance;
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +3 -0
@@ -180,6 +191,9 @@ int amdgpu_driver_load_kms(struct amdgpu_device
 *adev, unsigned long flags)
                */
               if (adev->is_fw_fb)
                       adev->runpm = false;
+
+             amdgpu_runtime_pm_quirk(adev);
+
               if (adev->runpm)
                       dev_info(adev->dev, "Using BACO for runtime
pm\n");
       }

--
2.17.1

#4 lore raw

I have submitted this patch to amd-staging-drm-next branch. Shall I need to improve it?

Regards,
Guchun

-----Original Message-----
From: Lazar, Lijo <[email protected]>
Sent: Thursday, April 28, 2022 12:18 AM
To: Alex Deucher <[email protected]>; Quan, Evan <[email protected]>
Cc: Chen, Guchun <[email protected]>; [email protected]; Koenig, Christian <[email protected]>; Zhang, Hawking <[email protected]>; Deucher, Alexander <[email protected]>
Subject: Re: [PATCH] drm/amdgpu: disable runtime pm on several sienna cichlid cards(v2)

Quoted 67 lines · Alex Deucher
Quoted 49 lines · Evan

[AMD Official Use Only - General]

Quoted 44 lines

-----Original Message-----
From: Chen, Guchun <[email protected]>
Sent: Wednesday, April 27, 2022 6:27 PM
To: [email protected]; Koenig, Christian <[email protected]>; Zhang, Hawking <[email protected]>; Deucher, Alexander <[email protected]>; Lazar, Lijo <[email protected]>; Quan, Evan <[email protected]>
Cc: Chen, Guchun <[email protected]>
Subject: [PATCH] drm/amdgpu: disable runtime pm on several sienna cichlid
cards(v2)

Disable runtime power management on several sienna cichlid cards, otherwise SMU will possibly fail to be resumed from runtime suspend. Will drop this after a clean solution between kernel driver and SMU FW is available.

amdgpu 0000:63:00.0: amdgpu: GECC is enabled amdgpu 0000:63:00.0:
amdgpu: SECUREDISPLAY: securedisplay ta ucode is not available amdgpu 0000:63:00.0: amdgpu: SMU is resuming...
amdgpu 0000:63:00.0: amdgpu: SMU: I'm not done with your command:
SMN_C2PMSG_66:0x0000000E SMN_C2PMSG_82:0x00000080 amdgpu 0000:63:00.0: amdgpu: Failed to SetDriverDramAddr! amdgpu 0000:63:00.0: amdgpu: Failed to setup smc hw! [drm:amdgpu_device_ip_resume_phase2 [amdgpu]] *ERROR* resume of IP block <smu> failed -62 amdgpu 0000:63:00.0: amdgpu:
amdgpu_device_ip_resume failed (-62)

v2: seperate to a function.

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 14 ++++++++++++++
  1 file changed, 14 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +0 -0
index 262938f0dfdb..1bf8ff71b6b5 100644
@@ -43,6 +43,17 @@
  #include "amdgpu_display.h"
  #include "amdgpu_ras.h"
 
Quoted 16 lines
Quoted 11 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +7 -0
+static void amdgpu_runtime_pm_quirk(struct amdgpu_device *adev) {
+     /*
+      * Add below quirk on several sienna_cichlid cards to disable
+      * runtime pm to fix EMI failures.
+      */
+     if (((adev->pdev->device == 0x73A1) && (adev->pdev->revision 
+==

0x00)) ||
+ ((adev->pdev->device == 0x73BF) && (adev->pdev->revision
+ ==
0xCF)))

drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c line 56

Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +3 -0
+             adev->runpm = false;
+}
+

[Quan, Evan] Better to move this to
sienna_cichlid_check_bxco_support(). As long as smu_baco->platform_support is set as false there, the runpm will be disabled accordingly I think.

Quoted 5 lines

Good point. We probably want to disable BACO entirely or enable the workaround because BACO could also be used for a GPU reset in some cases. Then only disable runtime pm if BACO will be used. BOCO should still work fine for example.

As far as I remember, the WA proposal still wants to retain BACO as a reset method.

Thanks,
Lijo

Quoted 24 lines

Alex

Quoted 22 lines

Either way the patch is reviewed-by: Evan Quan <[email protected]>

BR
Evan

Quoted 17 lines

void amdgpu_unregister_gpu_instance(struct amdgpu_device *adev)

  {
       struct amdgpu_gpu_instance *gpu_instance; @@ -180,6 +191,9 @@ 
int amdgpu_driver_load_kms(struct amdgpu_device *adev, unsigned long 
flags)
                */
               if (adev->is_fw_fb)
                       adev->runpm = false;
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +3 -0
+
+             amdgpu_runtime_pm_quirk(adev);
+
               if (adev->runpm)
                       dev_info(adev->dev, "Using BACO for runtime 
pm\n");
       }

--
2.17.1