On 2/28/2024 9:30 AM, Asad Kamal wrote: > Skip reporting pcie link width/speed on vfs for > smu_v13_0_6 & smu_v13_0_2 > > Signed-off-by: Asad Kamal <asad.kamal@xxxxxxx> > Reviewed-by: Yang Wang <kevinyang.wang@xxxxxxx> Reviewed-by: Lijo Lazar <lijo.lazar@xxxxxxx> Thanks, Lijo > --- > .../gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c | 10 ++++++---- > .../drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c | 18 ++++++++++-------- > 2 files changed, 16 insertions(+), 12 deletions(-) > > diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c > index f1440869d1ce..f122ef49106c 100644 > --- a/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c > +++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c > @@ -1747,10 +1747,12 @@ static ssize_t aldebaran_get_gpu_metrics(struct smu_context *smu, > > gpu_metrics->current_fan_speed = 0; > > - gpu_metrics->pcie_link_width = > - smu_v13_0_get_current_pcie_link_width(smu); > - gpu_metrics->pcie_link_speed = > - aldebaran_get_current_pcie_link_speed(smu); > + if (!amdgpu_sriov_vf(smu->adev)) { > + gpu_metrics->pcie_link_width = > + smu_v13_0_get_current_pcie_link_width(smu); > + gpu_metrics->pcie_link_speed = > + aldebaran_get_current_pcie_link_speed(smu); > + } > > gpu_metrics->system_clock_counter = ktime_get_boottime_ns(); > > 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 2b7a60b23d6b..69c64bc6e2dc 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 > @@ -2229,14 +2229,16 @@ static ssize_t smu_v13_0_6_get_gpu_metrics(struct smu_context *smu, void **table > gpu_metrics->gfxclk_lock_status = GET_METRIC_FIELD(GfxLockXCDMak) >> GET_INST(GC, 0); > > if (!(adev->flags & AMD_IS_APU)) { > - link_width_level = smu_v13_0_6_get_current_pcie_link_width_level(smu); > - if (link_width_level > MAX_LINK_WIDTH) > - link_width_level = 0; > - > - gpu_metrics->pcie_link_width = > - DECODE_LANE_WIDTH(link_width_level); > - gpu_metrics->pcie_link_speed = > - smu_v13_0_6_get_current_pcie_link_speed(smu); > + if (!amdgpu_sriov_vf(adev)) { > + link_width_level = smu_v13_0_6_get_current_pcie_link_width_level(smu); > + if (link_width_level > MAX_LINK_WIDTH) > + link_width_level = 0; > + > + gpu_metrics->pcie_link_width = > + DECODE_LANE_WIDTH(link_width_level); > + gpu_metrics->pcie_link_speed = > + smu_v13_0_6_get_current_pcie_link_speed(smu); > + } > gpu_metrics->pcie_bandwidth_acc = > SMUQ10_ROUND(metrics_x->PcieBandwidthAcc[0]); > gpu_metrics->pcie_bandwidth_inst =