Skip to contentSkip to conversation

drm/amdgpu/pm: add missing revision check for CI

PATCH In review Alex Deucher 3 participants 5 messages Apr 27 – Apr 28

Subsystems (3)
lore
Share & tools
lore

Alex Deucher

author maintainer
#0 lore raw

PATCH 1/2 drm/amdgpu/pm: add missing revision check for CI

The ci_populate_all_memory_levels() workaround only applies to revision 0 SKUs.

---
 drivers/gpu/drm/amd/pm/powerplay/smumgr/ci_smumgr.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/pm/powerplay/smumgr/ci_smumgr.c +3 -2
index 69d8b05ef2457..6e89a032e3dcf 100644
@@ -1333,8 +1333,9 @@ static int ci_populate_all_memory_levels(struct pp_hwmgr *hwmgr)
 
 	dev_id = adev->pdev->device;
 
-	if ((dpm_table->mclk_table.count >= 2)
-		&& ((dev_id == 0x67B0) ||  (dev_id == 0x67B1))) {
+	if ((dpm_table->mclk_table.count >= 2) &&
+	    ((dev_id == 0x67B0) ||  (dev_id == 0x67B1)) &&
+	    (adev->pdev->revision == 0)) {
 		smu_data->smc_state_table.MemoryLevel[1].MinVddci =
 				smu_data->smc_state_table.MemoryLevel[0].MinVddci;
 		smu_data->smc_state_table.MemoryLevel[1].MinMvdd =
Signature · 1 line
2.53.0
author maintainer
#1 lore raw

PATCH 2/2 drm/radeon: add missing revision check for CI

The memory level workarounds only apply to revision 0 SKUs.

---
 drivers/gpu/drm/radeon/ci_dpm.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/gpu/drm/radeon/ci_dpm.c +6 -3
index ba8db1d07c070..b47b91272b244 100644
@@ -2461,7 +2461,8 @@ static void ci_register_patching_mc_arb(struct radeon_device *rdev,
 
 	if (patch &&
 	    ((rdev->pdev->device == 0x67B0) ||
-	     (rdev->pdev->device == 0x67B1))) {
+	     (rdev->pdev->device == 0x67B1)) &&
+	    (rdev->pdev->revision == 0)) {
 		if ((memory_clock > 100000) && (memory_clock <= 125000)) {
 			tmp2 = (((0x31 * engine_clock) / 125000) - 1) & 0xff;
 			*dram_timimg2 &= ~0x00ff0000;
@@ -3304,7 +3305,8 @@ static int ci_populate_all_memory_levels(struct radeon_device *rdev)
 	pi->smc_state_table.MemoryLevel[0].EnabledForActivity = 1;
 
 	if ((dpm_table->mclk_table.count >= 2) &&
-	    ((rdev->pdev->device == 0x67B0) || (rdev->pdev->device == 0x67B1))) {
+	    ((rdev->pdev->device == 0x67B0) || (rdev->pdev->device == 0x67B1)) &&
+	    (rdev->pdev->revision == 0)) {
 		pi->smc_state_table.MemoryLevel[1].MinVddc =
 			pi->smc_state_table.MemoryLevel[0].MinVddc;
 		pi->smc_state_table.MemoryLevel[1].MinVddcPhases =
@@ -4493,7 +4495,8 @@ static int ci_register_patching_mc_seq(struct radeon_device *rdev,
 
 	if (patch &&
 	    ((rdev->pdev->device == 0x67B0) ||
-	     (rdev->pdev->device == 0x67B1))) {
+	     (rdev->pdev->device == 0x67B1)) &&
+	    (rdev->pdev->revision == 0)) {
 		for (i = 0; i < table->last; i++) {
 			if (table->last >= SMU7_DISCRETE_MC_REGISTER_ARRAY_SIZE)
 				return -EINVAL;
Signature · 1 line
2.53.0
Reviewed-by on v1 2/2
#2 lore raw

RE: [PATCH 2/2] drm/radeon: add missing revision check for CI

AMD General

Series is

Quoted 55 lines

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Alex Deucher
Sent: Monday, April 27, 2026 1:31 PM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>
Subject: [PATCH 2/2] drm/radeon: add missing revision check for CI

The memory level workarounds only apply to revision 0 SKUs.

---
 drivers/gpu/drm/radeon/ci_dpm.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/gpu/drm/radeon/ci_dpm.c +2 -1
index ba8db1d07c070..b47b91272b244 100644
@@ -2461,7 +2461,8 @@ static void ci_register_patching_mc_arb(struct
 radeon_device *rdev,
 
      if (patch &&
          ((rdev->pdev->device == 0x67B0) ||
-          (rdev->pdev->device == 0x67B1))) {
+          (rdev->pdev->device == 0x67B1)) &&
+         (rdev->pdev->revision == 0)) {
              if ((memory_clock > 100000) && (memory_clock <= 125000)) {
                      tmp2 = (((0x31 * engine_clock) / 125000) - 1) & 0xff;
                      *dram_timimg2 &= ~0x00ff0000;
drivers/gpu/drm/radeon/ci_dpm.c +2 -1
@@ -3304,7 +3305,8 @@ static int ci_populate_all_memory_levels(struct
 radeon_device *rdev)
      pi->smc_state_table.MemoryLevel[0].EnabledForActivity = 1;
 
      if ((dpm_table->mclk_table.count >= 2) &&
-         ((rdev->pdev->device == 0x67B0) || (rdev->pdev->device == 0x67B1))) {
+         ((rdev->pdev->device == 0x67B0) || (rdev->pdev->device == 0x67B1)) &&
+         (rdev->pdev->revision == 0)) {
              pi->smc_state_table.MemoryLevel[1].MinVddc =
                      pi->smc_state_table.MemoryLevel[0].MinVddc;
              pi->smc_state_table.MemoryLevel[1].MinVddcPhases =
drivers/gpu/drm/radeon/ci_dpm.c +2 -1
@@ -4493,7 +4495,8 @@ static int ci_register_patching_mc_seq(struct
 radeon_device *rdev,
 
      if (patch &&
          ((rdev->pdev->device == 0x67B0) ||
-          (rdev->pdev->device == 0x67B1))) {
+          (rdev->pdev->device == 0x67B1)) &&
+         (rdev->pdev->revision == 0)) {
              for (i = 0; i < table->last; i++) {
                      if (table->last >=

SMU7_DISCRETE_MC_REGISTER_ARRAY_SIZE)

                              return -EINVAL;

--
2.53.0

Reviewed-by on v1 2/2
#3 lore raw

Re: [PATCH 2/2] drm/radeon: add missing revision check for CI

In reply to Alex Deucher
Quoted 3 lines · Central European Summer Time Alex Deucher

The memory level workarounds only apply to revision 0 SKUs.

It is important that stable kernels (and stable distros) pick up this patch. Can you please add a few tags to this commit to give extra context?

Fixes 127e056e2a82 ("drm/radeon: fix mclk vddc configuration for cards for

hawaii")

Fixes 21b8a369046f ("drm/radeon: fix dram timing for certain hawaii boards")
Fixes 90b2fee35cb9 ("drm/radeon: fix dpm mc init for certain hawaii boards")

With that, this patch is also:

Thanks & best regards,
Timur

Quoted 9 lines
---
 drivers/gpu/drm/radeon/ci_dpm.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
(quoted diff) +0 -0

b/drivers/gpu/drm/radeon/ci_dpm.c index ba8db1d07c070..b47b91272b244 100644

drivers/gpu/drm/radeon/ci_dpm.c static void ci_register_patching_mc_arb(struct · line 2467

Quoted 8 lines
drivers/gpu/drm/radeon/ci_dpm.c +2 -1
@@ -2461,7 +2461,8 @@ static void ci_register_patching_mc_arb(struct
 radeon_device *rdev,
 
 	if (patch &&
 	    ((rdev->pdev->device == 0x67B0) ||
-	     (rdev->pdev->device == 0x67B1))) {
+	     (rdev->pdev->device == 0x67B1)) &&
+	    (rdev->pdev->revision == 0)) {
 		if ((memory_clock > 100000) && (memory_clock <= 

125000)) {

drivers/gpu/drm/radeon/ci_dpm.c static void ci_register_patching_mc_arb(struct · line 2468

Quoted 1 line
drivers/gpu/drm/radeon/ci_dpm.c +0 -0
 			tmp2 = (((0x31 * engine_clock) / 125000) - 

1) & 0xff;

drivers/gpu/drm/radeon/ci_dpm.c

Quoted 7 lines
drivers/gpu/drm/radeon/ci_dpm.c +0 -0
 			*dram_timimg2 &= ~0x00ff0000;
@@ -3304,7 +3305,8 @@ static int ci_populate_all_memory_levels(struct

radeon_device *rdev) pi->smc_state_table.MemoryLevel[0].EnabledForActivity = 1;

drivers/gpu/drm/radeon/ci_dpm.c +0 -1
 	if ((dpm_table->mclk_table.count >= 2) &&
-	    ((rdev->pdev->device == 0x67B0) || (rdev->pdev->device == 

0x67B1))) {

drivers/gpu/drm/radeon/ci_dpm.c

Quoted 1 line
drivers/gpu/drm/radeon/ci_dpm.c +1 -0
+	    ((rdev->pdev->device == 0x67B0) || (rdev->pdev->device == 

0x67B1)) &&

Quoted 5 lines
drivers/gpu/drm/radeon/ci_dpm.c +1 -0
+	    (rdev->pdev->revision == 0)) {
 		pi->smc_state_table.MemoryLevel[1].MinVddc =
 			pi->smc_state_table.MemoryLevel[0].MinVddc;
 		pi->smc_state_table.MemoryLevel[1].MinVddcPhases =

drivers/gpu/drm/radeon/ci_dpm.c static int ci_register_patching_mc_seq(struct · line 4502

Quoted 9 lines
drivers/gpu/drm/radeon/ci_dpm.c +2 -1
@@ -4493,7 +4495,8 @@ static int ci_register_patching_mc_seq(struct
 radeon_device *rdev,
 
 	if (patch &&
 	    ((rdev->pdev->device == 0x67B0) ||
-	     (rdev->pdev->device == 0x67B1))) {
+	     (rdev->pdev->device == 0x67B1)) &&
+	    (rdev->pdev->revision == 0)) {
 		for (i = 0; i < table->last; i++) {
 			if (table->last >= 

SMU7_DISCRETE_MC_REGISTER_ARRAY_SIZE)

Quoted 1 line

return -EINVAL;

Reviewed-by on v1 1/2
#4 lore raw
In reply to Alex Deucher

Hi Alex,

Quoted 2 lines · Central European Summer Time Alex Deucher

The ci_populate_all_memory_levels() workaround only applies to revision 0 SKUs.

This makes good sense. Looking at issue 1816, seems that the affected GPU is revision 80, and looking at my Hawaii card, it seems to be also 80:

01:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ ATI] Hawaii XT / Grenada XT [Radeon R9 290X/390X] [1002:67b0] (rev 80) (prog- if 00 [VGA controller])

Can you please add a few tags for additional context?

Fixes 9f4b35411cfe ("drm/amd/powerplay: add CI asics support to smumgr (v3)")
Quoted 23 lines
---
 drivers/gpu/drm/amd/pm/powerplay/smumgr/ci_smumgr.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
(quoted diff) +0 -0

b/drivers/gpu/drm/amd/pm/powerplay/smumgr/ci_smumgr.c index 69d8b05ef2457..6e89a032e3dcf 100644

drivers/gpu/drm/amd/pm/powerplay/smumgr/ci_smumgr.c +3 -2
@@ -1333,8 +1333,9 @@ static int ci_populate_all_memory_levels(struct
 pp_hwmgr *hwmgr)
 
 	dev_id = adev->pdev->device;
 
-	if ((dpm_table->mclk_table.count >= 2)
-		&& ((dev_id == 0x67B0) ||  (dev_id == 0x67B1))) {
+	if ((dpm_table->mclk_table.count >= 2) &&
+	    ((dev_id == 0x67B0) ||  (dev_id == 0x67B1)) &&
+	    (adev->pdev->revision == 0)) {
 		smu_data->smc_state_table.MemoryLevel[1].MinVddci =
 				smu_data-
Quoted 2 lines

smc_state_table.MemoryLevel[0].MinVddci;
smu_data->smc_state_table.MemoryLevel[1].MinMvdd =

It looks like amdgpu and radeon behave differently here: radeon overwrites the MinVddc and MinVddcPhases vs. amdgpu overwrites MinVddci and MinMvdd.

Without knowing more details of what the workaround was trying to achieve, it's hard to judge whether radeon or amdgpu was correct, but it would be nice to make them consistent. If radeon was correct, could you adjust the amdgpu code here to do the same? (Or vice versa if amdgpu was correct.)

With that, the series is:

Thanks & best regards,
Timur