Skip to contentSkip to conversation

drm/amd/pm: enable pm sysfs write for one VF mode

PATCH In review Yiqing Yao 2 participants 2 messages Jan 24, 2022 – Feb 15, 2022

Subsystems (3)
lore
Share & tools
lore

Yiqing Yao

author
#0 lore raw

PATCH 1/1 drm/amd/pm: enable pm sysfs write for one VF mode

[why]
pm sysfs should be writable in one VF mode as is in passthrough

[how]
do not remove write access on pm sysfs if device is in one VF mode

Fixes 4436ea3c43a7 ("amdgpu/pm: Make sysfs pm attributes as read-only for VFs")
---
 drivers/gpu/drm/amd/pm/amdgpu_pm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/pm/amdgpu_pm.c +2 -2
index 837a31a46596..5250032a2ffb 100644
@@ -2006,8 +2006,8 @@ static int default_attr_update(struct amdgpu_device *adev, struct amdgpu_device_
 		}
 	}
 
-	/* setting should not be allowed from VF */
-	if (amdgpu_sriov_vf(adev)) {
+	/* setting should not be allowed from VF if not in one VF mode */
+	if (amdgpu_sriov_vf(adev) && !amdgpu_sriov_is_pp_one_vf(adev)) {
 		dev_attr->attr.mode &= ~S_IWUGO;
 		dev_attr->store = NULL;
 	}
Signature · 1 line
2.25.1
#1 lore raw
Quoted 10 lines · Monk

[AMD Official Use Only]

Reviewed-by [email protected]

Thanks

-------------------------------------------------------------------

Monk Liu | Cloud GPU & Virtualization Solution | AMD

Quoted 27 lines · Yiqing Yao

[why]
pm sysfs should be writable in one VF mode as is in passthrough

[how]
do not remove write access on pm sysfs if device is in one VF mode

Fixes 4436ea3c43a7 ("amdgpu/pm: Make sysfs pm attributes as read-only for VFs")
---
  drivers/gpu/drm/amd/pm/amdgpu_pm.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/pm/amdgpu_pm.c +2 -2
index 837a31a46596..5250032a2ffb 100644
@@ -2006,8 +2006,8 @@ static int default_attr_update(struct amdgpu_device *adev, struct amdgpu_device_
  		}
  	}
 
-	/* setting should not be allowed from VF */
-	if (amdgpu_sriov_vf(adev)) {
+	/* setting should not be allowed from VF if not in one VF mode */
+	if (amdgpu_sriov_vf(adev) && !amdgpu_sriov_is_pp_one_vf(adev)) {
  		dev_attr->attr.mode &= ~S_IWUGO;
  		dev_attr->store = NULL;
  	}