Skip to contentSkip to conversation

drm/amdgpu: Hide xcp partition sysfs under SRIOV

PATCH In review Rajneesh Bhardwaj 2 participants 2 messages Aug 24, 2023 – Aug 25, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: Hide xcp partition sysfs under SRIOV

XCP partitions should not be visible for the VF for GFXIP 9.4.3.

---
 drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c +8 -3
index b4fdb269f856..b1ca3014a9e2 100644
@@ -863,11 +863,15 @@ static int gfx_v9_4_3_sw_init(void *handle)
 	if (r)
 		return r;
 
-	r = amdgpu_gfx_sysfs_init(adev);
+	r = amdgpu_gfx_ras_sw_init(adev);
 	if (r)
 		return r;
 
-	return amdgpu_gfx_ras_sw_init(adev);
+
+	if (!amdgpu_sriov_vf(adev))
+		r = amdgpu_gfx_sysfs_init(adev);
+
+	return r;
 }
 
 static int gfx_v9_4_3_sw_fini(void *handle)
@@ -888,7 +892,8 @@ static int gfx_v9_4_3_sw_fini(void *handle)
 	gfx_v9_4_3_mec_fini(adev);
 	amdgpu_bo_unref(&adev->gfx.rlc.clear_state_obj);
 	gfx_v9_4_3_free_microcode(adev);
-	amdgpu_gfx_sysfs_fini(adev);
+	if (!amdgpu_sriov_vf(adev))
+		amdgpu_gfx_sysfs_fini(adev);
 
 	return 0;
 }
Signature · 1 line
2.17.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 3 lines · Rajneesh Bhardwaj

XCP partitions should not be visible for the VF for GFXIP 9.4.3.

Thanks,
Lijo

Quoted 36 lines
---
  drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c | 11 ++++++++---
  1 file changed, 8 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c +8 -3
index b4fdb269f856..b1ca3014a9e2 100644
@@ -863,11 +863,15 @@ static int gfx_v9_4_3_sw_init(void *handle)
  	if (r)
  		return r;
 
-	r = amdgpu_gfx_sysfs_init(adev);
+	r = amdgpu_gfx_ras_sw_init(adev);
  	if (r)
  		return r;
 
-	return amdgpu_gfx_ras_sw_init(adev);
+
+	if (!amdgpu_sriov_vf(adev))
+		r = amdgpu_gfx_sysfs_init(adev);
+
+	return r;
  }
 
  static int gfx_v9_4_3_sw_fini(void *handle)
@@ -888,7 +892,8 @@ static int gfx_v9_4_3_sw_fini(void *handle)
  	gfx_v9_4_3_mec_fini(adev);
  	amdgpu_bo_unref(&adev->gfx.rlc.clear_state_obj);
  	gfx_v9_4_3_free_microcode(adev);
-	amdgpu_gfx_sysfs_fini(adev);
+	if (!amdgpu_sriov_vf(adev))
+		amdgpu_gfx_sysfs_fini(adev);
 
  	return 0;
  }