File tree Expand file tree Collapse file tree 7 files changed +25
-14
lines changed
drivers/gpu/drm/amd/amdgpu Expand file tree Collapse file tree 7 files changed +25
-14
lines changed Original file line number Diff line number Diff line change @@ -1778,9 +1778,11 @@ int amdgpu_gfx_sysfs_init(struct amdgpu_device *adev)
1778
1778
1779
1779
void amdgpu_gfx_sysfs_fini (struct amdgpu_device * adev )
1780
1780
{
1781
- amdgpu_gfx_sysfs_xcp_fini (adev );
1782
- amdgpu_gfx_sysfs_isolation_shader_fini (adev );
1783
- amdgpu_gfx_sysfs_reset_mask_fini (adev );
1781
+ if (adev -> dev -> kobj .sd ) {
1782
+ amdgpu_gfx_sysfs_xcp_fini (adev );
1783
+ amdgpu_gfx_sysfs_isolation_shader_fini (adev );
1784
+ amdgpu_gfx_sysfs_reset_mask_fini (adev );
1785
+ }
1784
1786
}
1785
1787
1786
1788
int amdgpu_gfx_cleaner_shader_sw_init (struct amdgpu_device * adev ,
Original file line number Diff line number Diff line change @@ -447,6 +447,8 @@ int amdgpu_jpeg_sysfs_reset_mask_init(struct amdgpu_device *adev)
447
447
448
448
void amdgpu_jpeg_sysfs_reset_mask_fini (struct amdgpu_device * adev )
449
449
{
450
- if (adev -> jpeg .num_jpeg_inst )
451
- device_remove_file (adev -> dev , & dev_attr_jpeg_reset_mask );
450
+ if (adev -> dev -> kobj .sd ) {
451
+ if (adev -> jpeg .num_jpeg_inst )
452
+ device_remove_file (adev -> dev , & dev_attr_jpeg_reset_mask );
453
+ }
452
454
}
Original file line number Diff line number Diff line change @@ -137,7 +137,8 @@ void amdgpu_preempt_mgr_fini(struct amdgpu_device *adev)
137
137
if (ret )
138
138
return ;
139
139
140
- device_remove_file (adev -> dev , & dev_attr_mem_info_preempt_used );
140
+ if (adev -> dev -> kobj .sd )
141
+ device_remove_file (adev -> dev , & dev_attr_mem_info_preempt_used );
141
142
142
143
ttm_resource_manager_cleanup (man );
143
144
ttm_set_driver_manager (& adev -> mman .bdev , AMDGPU_PL_PREEMPT , NULL );
Original file line number Diff line number Diff line change @@ -451,6 +451,8 @@ void amdgpu_sdma_sysfs_reset_mask_fini(struct amdgpu_device *adev)
451
451
if (!amdgpu_gpu_recovery )
452
452
return ;
453
453
454
- if (adev -> sdma .num_instances )
455
- device_remove_file (adev -> dev , & dev_attr_sdma_reset_mask );
454
+ if (adev -> dev -> kobj .sd ) {
455
+ if (adev -> sdma .num_instances )
456
+ device_remove_file (adev -> dev , & dev_attr_sdma_reset_mask );
457
+ }
456
458
}
Original file line number Diff line number Diff line change @@ -1315,6 +1315,8 @@ int amdgpu_vcn_sysfs_reset_mask_init(struct amdgpu_device *adev)
1315
1315
1316
1316
void amdgpu_vcn_sysfs_reset_mask_fini (struct amdgpu_device * adev )
1317
1317
{
1318
- if (adev -> vcn .num_vcn_inst )
1319
- device_remove_file (adev -> dev , & dev_attr_vcn_reset_mask );
1318
+ if (adev -> dev -> kobj .sd ) {
1319
+ if (adev -> vcn .num_vcn_inst )
1320
+ device_remove_file (adev -> dev , & dev_attr_vcn_reset_mask );
1321
+ }
1320
1322
}
Original file line number Diff line number Diff line change @@ -904,8 +904,10 @@ int amdgpu_vpe_sysfs_reset_mask_init(struct amdgpu_device *adev)
904
904
905
905
void amdgpu_vpe_sysfs_reset_mask_fini (struct amdgpu_device * adev )
906
906
{
907
- if (adev -> vpe .num_instances )
908
- device_remove_file (adev -> dev , & dev_attr_vpe_reset_mask );
907
+ if (adev -> dev -> kobj .sd ) {
908
+ if (adev -> vpe .num_instances )
909
+ device_remove_file (adev -> dev , & dev_attr_vpe_reset_mask );
910
+ }
909
911
}
910
912
911
913
static const struct amdgpu_ring_funcs vpe_ring_funcs = {
Original file line number Diff line number Diff line change @@ -254,8 +254,8 @@ static void df_v3_6_sw_init(struct amdgpu_device *adev)
254
254
255
255
static void df_v3_6_sw_fini (struct amdgpu_device * adev )
256
256
{
257
-
258
- device_remove_file (adev -> dev , & dev_attr_df_cntr_avail );
257
+ if ( adev -> dev -> kobj . sd )
258
+ device_remove_file (adev -> dev , & dev_attr_df_cntr_avail );
259
259
260
260
}
261
261
You can’t perform that action at this time.
0 commit comments