<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<p style="font-family:Arial;font-size:10pt;color:#0000FF;margin:5pt;" align="Left">
[AMD Official Use Only]<br>
</p>
<br>
<div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Reviewed-by: Kevin Wang <kevinyang.wang@amd.com></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Best Regards,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Kevin</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Marina Nikolic <Marina.Nikolic@amd.com><br>
<b>Sent:</b> Tuesday, January 18, 2022 12:21 AM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org><br>
<b>Cc:</b> Mitrovic, Milan <Milan.Mitrovic@amd.com>; Veljkovic, Nikola <Nikola.Veljkovic@amd.com>; Nikolic, Marina <Marina.Nikolic@amd.com>; Kitchen, Greg <Greg.Kitchen@amd.com><br>
<b>Subject:</b> [PATCH] drm/amd/pm: Enable sysfs required by rocm-smi tool for One VF mode</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt">
<div class="PlainText">Enable power level, power limit and fan speed<br>
information retrieval in one VF mode.<br>
This is required so that tool ROCM-SMI<br>
can provide this information to users.<br>
---<br>
 drivers/gpu/drm/amd/pm/amdgpu_pm.c              | 17 ++---------------<br>
 .../drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c |  2 +-<br>
 2 files changed, 3 insertions(+), 16 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/pm/amdgpu_pm.c b/drivers/gpu/drm/amd/pm/amdgpu_pm.c<br>
index 1b03ad7a21ad..bb7d03cd814c 100644<br>
--- a/drivers/gpu/drm/amd/pm/amdgpu_pm.c<br>
+++ b/drivers/gpu/drm/amd/pm/amdgpu_pm.c<br>
@@ -1903,8 +1903,8 @@ static struct amdgpu_device_attr amdgpu_device_attrs[] = {<br>
         AMDGPU_DEVICE_ATTR_RW(pp_dpm_fclk,                              ATTR_FLAG_BASIC|ATTR_FLAG_ONEVF),<br>
         AMDGPU_DEVICE_ATTR_RW(pp_dpm_vclk,                              ATTR_FLAG_BASIC|ATTR_FLAG_ONEVF),<br>
         AMDGPU_DEVICE_ATTR_RW(pp_dpm_dclk,                              ATTR_FLAG_BASIC|ATTR_FLAG_ONEVF),<br>
-       AMDGPU_DEVICE_ATTR_RW(pp_dpm_dcefclk,                           ATTR_FLAG_BASIC),<br>
-       AMDGPU_DEVICE_ATTR_RW(pp_dpm_pcie,                              ATTR_FLAG_BASIC),<br>
+       AMDGPU_DEVICE_ATTR_RW(pp_dpm_dcefclk,                           ATTR_FLAG_BASIC|ATTR_FLAG_ONEVF),<br>
+       AMDGPU_DEVICE_ATTR_RW(pp_dpm_pcie,                              ATTR_FLAG_BASIC|ATTR_FLAG_ONEVF),<br>
         AMDGPU_DEVICE_ATTR_RW(pp_sclk_od,                               ATTR_FLAG_BASIC),<br>
         AMDGPU_DEVICE_ATTR_RW(pp_mclk_od,                               ATTR_FLAG_BASIC),<br>
         AMDGPU_DEVICE_ATTR_RW(pp_power_profile_mode,                    ATTR_FLAG_BASIC|ATTR_FLAG_ONEVF),<br>
@@ -3152,19 +3152,6 @@ static umode_t hwmon_attributes_visible(struct kobject *kobj,<br>
         if (amdgpu_sriov_vf(adev) && !amdgpu_sriov_is_pp_one_vf(adev))<br>
                 return 0;<br>
 <br>
-       /* there is no fan under pp one vf mode */<br>
-       if (amdgpu_sriov_is_pp_one_vf(adev) &&<br>
-           (attr == &sensor_dev_attr_pwm1.dev_attr.attr ||<br>
-            attr == &sensor_dev_attr_pwm1_enable.dev_attr.attr ||<br>
-            attr == &sensor_dev_attr_pwm1_max.dev_attr.attr ||<br>
-            attr == &sensor_dev_attr_pwm1_min.dev_attr.attr ||<br>
-            attr == &sensor_dev_attr_fan1_input.dev_attr.attr ||<br>
-            attr == &sensor_dev_attr_fan1_min.dev_attr.attr ||<br>
-            attr == &sensor_dev_attr_fan1_max.dev_attr.attr ||<br>
-            attr == &sensor_dev_attr_fan1_target.dev_attr.attr ||<br>
-            attr == &sensor_dev_attr_fan1_enable.dev_attr.attr))<br>
-               return 0;<br>
-<br>
         /* Skip fan attributes if fan is not present */<br>
         if (adev->pm.no_fan && (attr == &sensor_dev_attr_pwm1.dev_attr.attr ||<br>
             attr == &sensor_dev_attr_pwm1_enable.dev_attr.attr ||<br>
diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c<br>
index 4e37cd8025ed..7ea0427f65d3 100644<br>
--- a/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c<br>
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c<br>
@@ -134,7 +134,7 @@ static struct cmn2asic_msg_mapping sienna_cichlid_message_map[SMU_MSG_MAX_COUNT]<br>
         MSG_MAP(PrepareMp1ForUnload,            PPSMC_MSG_PrepareMp1ForUnload,         1),<br>
         MSG_MAP(AllowGfxOff,                    PPSMC_MSG_AllowGfxOff,                 0),<br>
         MSG_MAP(DisallowGfxOff,                 PPSMC_MSG_DisallowGfxOff,              0),<br>
-       MSG_MAP(GetPptLimit,                    PPSMC_MSG_GetPptLimit,                 0),<br>
+       MSG_MAP(GetPptLimit,                    PPSMC_MSG_GetPptLimit,                 1),<br>
         MSG_MAP(GetDcModeMaxDpmFreq,            PPSMC_MSG_GetDcModeMaxDpmFreq,         1),<br>
         MSG_MAP(ExitBaco,                       PPSMC_MSG_ExitBaco,                    0),<br>
         MSG_MAP(PowerUpVcn,                     PPSMC_MSG_PowerUpVcn,                  0),<br>
-- <br>
2.20.1<br>
<br>
</div>
</span></font></div>
</div>
</body>
</html>