Skip to contentSkip to conversation

drm/amdgpu: enable enforce_isolation sysfs node on VFs

PATCH In review Alex Deucher 2 participants 2 messages Oct 8, 2024 – Oct 9, 2024

Subsystems (2)
lore
Share & tools
lore

Alex Deucher

author maintainer
#0 lore raw

PATCH 1/1 drm/amdgpu: enable enforce_isolation sysfs node on VFs

It should be enabled on both bare metal and VFs.

Fixes e189be9b2e38 ("drm/amdgpu: Add enforce_isolation sysfs attribute")
Cc Srinivasan Shanmugam <[email protected]>
Cc Amber Lin <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +4 -7
index 2fe75c920a73..ae692d0591ba 100644
@@ -1625,11 +1625,9 @@ int amdgpu_gfx_sysfs_isolation_shader_init(struct amdgpu_device *adev)
 {
 	int r;
 
-	if (!amdgpu_sriov_vf(adev)) {
-		r = device_create_file(adev->dev, &dev_attr_enforce_isolation);
-		if (r)
-			return r;
-	}
+	r = device_create_file(adev->dev, &dev_attr_enforce_isolation);
+	if (r)
+		return r;
 
 	r = device_create_file(adev->dev, &dev_attr_run_cleaner_shader);
 	if (r)
@@ -1640,8 +1638,7 @@ int amdgpu_gfx_sysfs_isolation_shader_init(struct amdgpu_device *adev)
 
 void amdgpu_gfx_sysfs_isolation_shader_fini(struct amdgpu_device *adev)
 {
-	if (!amdgpu_sriov_vf(adev))
-		device_remove_file(adev->dev, &dev_attr_enforce_isolation);
+	device_remove_file(adev->dev, &dev_attr_enforce_isolation);
 	device_remove_file(adev->dev, &dev_attr_run_cleaner_shader);
 }
 
Signature · 1 line
2.46.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 30 lines · Alex Deucher

It should be enabled on both bare metal and VFs.

Fixes e189be9b2e38 ("drm/amdgpu: Add enforce_isolation sysfs attribute")
Cc Srinivasan Shanmugam<[email protected]>
Cc Amber Lin<[email protected]>
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 11 ++++-------
  1 file changed, 4 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +3 -5
index 2fe75c920a73..ae692d0591ba 100644
@@ -1625,11 +1625,9 @@ int amdgpu_gfx_sysfs_isolation_shader_init(struct amdgpu_device *adev)
  {
  	int r;
 
-	if (!amdgpu_sriov_vf(adev)) {
-		r = device_create_file(adev->dev, &dev_attr_enforce_isolation);
-		if (r)
-			return r;
-	}
+	r = device_create_file(adev->dev, &dev_attr_enforce_isolation);
+	if (r)
+		return r;
 
  	r = device_create_file(adev->dev, &dev_attr_run_cleaner_shader);
  	if (r)

drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c int amdgpu_gfx_sysfs_isolation_shader_init(struct amdgpu_device *adev) · line 1644

Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +1 -2
@@ -1640,8 +1638,7 @@ int amdgpu_gfx_sysfs_isolation_shader_init(struct amdgpu_device *adev)
 
  void amdgpu_gfx_sysfs_isolation_shader_fini(struct amdgpu_device *adev)
  {
-	if (!amdgpu_sriov_vf(adev))
-		device_remove_file(adev->dev, &dev_attr_enforce_isolation);
+	device_remove_file(adev->dev, &dev_attr_enforce_isolation);
  	device_remove_file(adev->dev, &dev_attr_run_cleaner_shader);
  }