Skip to contentSkip to conversation

drm/amd/pm: fix wrong pcie parameter on navi1x

PATCH Superseded Yang Wang 2 participants 4 messages Dec 15, 2025

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Yang Wang

author
#0 lore raw

PATCH 1/2 drm/amd/pm: fix wrong pcie parameter on navi1x

fix wrong pcie dpm parameter on navi1x

Fixes 1a18607c07bb ("drm/amd/pm: override pcie dpm parameters only if it is necessary")
---
 drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +2 -2
index 882830770b79..0c26fe6fb949 100644
@@ -2216,8 +2216,8 @@ static int navi10_update_pcie_parameters(struct smu_context *smu,
 									pptable->PcieLaneCount[i] > pcie_width_cap ?
 									pcie_width_cap : pptable->PcieLaneCount[i];
 			smu_pcie_arg = i << 16;
-			smu_pcie_arg |= pcie_gen_cap << 8;
-			smu_pcie_arg |= pcie_width_cap;
+			smu_pcie_arg |= dpm_context->dpm_tables.pcie_table.pcie_gen[i] << 8;
+			smu_pcie_arg |= dpm_context->dpm_tables.pcie_table.pcie_lane[i];
 			ret = smu_cmn_send_smc_msg_with_param(smu,
 							SMU_MSG_OverridePcieParameters,
 							smu_pcie_arg,
Signature · 1 line
2.34.1
author
#1 lore raw

PATCH 2/2 drm/amd/pm: force send pcie parmater on navi1x

the PMFW didn't initialize the PCIe DPM parameters and requires the KMD to actively provide these parameters.

---
 .../gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c    | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +9 -9
index 0c26fe6fb949..96dbb7a9d9fb 100644
@@ -2215,16 +2215,16 @@ static int navi10_update_pcie_parameters(struct smu_context *smu,
 			dpm_context->dpm_tables.pcie_table.pcie_lane[i] =
 									pptable->PcieLaneCount[i] > pcie_width_cap ?
 									pcie_width_cap : pptable->PcieLaneCount[i];
-			smu_pcie_arg = i << 16;
-			smu_pcie_arg |= dpm_context->dpm_tables.pcie_table.pcie_gen[i] << 8;
-			smu_pcie_arg |= dpm_context->dpm_tables.pcie_table.pcie_lane[i];
-			ret = smu_cmn_send_smc_msg_with_param(smu,
-							SMU_MSG_OverridePcieParameters,
-							smu_pcie_arg,
-							NULL);
-			if (ret)
-				break;
 		}
+		smu_pcie_arg = i << 16;
+		smu_pcie_arg |= dpm_context->dpm_tables.pcie_table.pcie_gen[i] << 8;
+		smu_pcie_arg |= dpm_context->dpm_tables.pcie_table.pcie_lane[i];
+		ret = smu_cmn_send_smc_msg_with_param(smu,
+						      SMU_MSG_OverridePcieParameters,
+						      smu_pcie_arg,
+						      NULL);
+		if (ret)
+			return ret;
 	}
 
 	return ret;
Signature · 1 line
2.34.1
#2 lore raw

Re: [PATCH 2/2] drm/amd/pm: force send pcie parmater on navi1x

Quoted 3 lines · Yang Wang

the PMFW didn't initialize the PCIe DPM parameters and requires the KMD to actively provide these parameters.

If this needs to be provided always, shouldn't this also revert the if check introduced by

1a18607c07bb ("drm/amd/pm: override pcie dpm parameters only if it is necessary")

Thanks,
Lijo

Quoted 35 lines
---
  .../gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c    | 18 +++++++++---------
  1 file changed, 9 insertions(+), 9 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +9 -9
index 0c26fe6fb949..96dbb7a9d9fb 100644
@@ -2215,16 +2215,16 @@ static int navi10_update_pcie_parameters(struct smu_context *smu,
  			dpm_context->dpm_tables.pcie_table.pcie_lane[i] =
  									pptable->PcieLaneCount[i] > pcie_width_cap ?
  									pcie_width_cap : pptable->PcieLaneCount[i];
-			smu_pcie_arg = i << 16;
-			smu_pcie_arg |= dpm_context->dpm_tables.pcie_table.pcie_gen[i] << 8;
-			smu_pcie_arg |= dpm_context->dpm_tables.pcie_table.pcie_lane[i];
-			ret = smu_cmn_send_smc_msg_with_param(smu,
-							SMU_MSG_OverridePcieParameters,
-							smu_pcie_arg,
-							NULL);
-			if (ret)
-				break;
  		}
+		smu_pcie_arg = i << 16;
+		smu_pcie_arg |= dpm_context->dpm_tables.pcie_table.pcie_gen[i] << 8;
+		smu_pcie_arg |= dpm_context->dpm_tables.pcie_table.pcie_lane[i];
+		ret = smu_cmn_send_smc_msg_with_param(smu,
+						      SMU_MSG_OverridePcieParameters,
+						      smu_pcie_arg,
+						      NULL);
+		if (ret)
+			return ret;
  	}
 
  	return ret;
#3 lore raw

Re: [PATCH 2/2] drm/amd/pm: force send pcie parmater on navi1x

Quoted 11 lines · Lijo
Quoted 3 lines · Yang Wang

the PMFW didn't initialize the PCIe DPM parameters and requires the KMD to actively provide these parameters.

If this needs to be provided always, shouldn't this also revert the if check introduced by

1a18607c07bb ("drm/amd/pm: override pcie dpm parameters only if it is necessary")

This check to be specific - https://github.com/torvalds/linux/blob/master/drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c#L2458

From the patch description, it sounds like this should be removed also so that pcie params are always provided by KMD.

Thanks,
Lijo

Quoted 43 lines

Thanks,
Lijo

Quoted 39 lines

---
  .../gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c    | 18 +++++++++---------

  1 file changed, 9 insertions(+), 9 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +0 -0
index 0c26fe6fb949..96dbb7a9d9fb 100644
@@ -2215,16 +2215,16 @@ static int 
 navi10_update_pcie_parameters(struct smu_context *smu,

              dpm_context->dpm_tables.pcie_table.pcie_lane[i] = pptable->PcieLaneCount[i] > pcie_width_cap ? pcie_width_cap : pptable-

Quoted 1 line

PcieLaneCount[i];

-            smu_pcie_arg = i << 16;
-            smu_pcie_arg |= dpm_context-

Quoted 1 line

dpm_tables.pcie_table.pcie_gen[i] << 8;

-            smu_pcie_arg |= dpm_context-

Quoted 1 line

dpm_tables.pcie_table.pcie_lane[i];

-            ret = smu_cmn_send_smc_msg_with_param(smu, -                            SMU_MSG_OverridePcieParameters, -                            smu_pcie_arg,
-                            NULL);
-            if (ret)
-                break;
          }
+        smu_pcie_arg = i << 16;
+        smu_pcie_arg |= dpm_context-

Quoted 1 line

dpm_tables.pcie_table.pcie_gen[i] << 8;

+        smu_pcie_arg |= dpm_context->dpm_tables.pcie_table.pcie_lane[i]; +        ret = smu_cmn_send_smc_msg_with_param(smu,
+                              SMU_MSG_OverridePcieParameters, +                              smu_pcie_arg,
+                              NULL);
+        if (ret)
+            return ret;
      }
      return ret;