Skip to content

Commit e433adc

Browse files
effective-lightalexdeucher
authored andcommitted
drm/amd/display: fix issues with driver unload
Currently, we run into a number of WARN()s when attempting to unload the amdgpu driver (e.g. using "modprobe -r amdgpu"). These all stem from calling drm_encoder_cleanup() too early. So, to fix this we can stop calling drm_encoder_cleanup() from amdgpu_dm_fini() and instead have it be called from amdgpu_dm_encoder_destroy(). Also, we don't need to free in amdgpu_dm_encoder_destroy() since mst_encoders[] isn't explicitly allocated by the slab allocator. Fixes: f74367e ("drm/amdgpu/display: create fake mst encoders ahead of time (v4)") Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Hamza Mahfooz <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 74ea8e7 commit e433adc

File tree

2 files changed

+0
-5
lines changed

2 files changed

+0
-5
lines changed

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1730,10 +1730,6 @@ static void amdgpu_dm_fini(struct amdgpu_device *adev)
17301730
adev->dm.vblank_control_workqueue = NULL;
17311731
}
17321732

1733-
for (i = 0; i < adev->dm.display_indexes_num; i++) {
1734-
drm_encoder_cleanup(&adev->dm.mst_encoders[i].base);
1735-
}
1736-
17371733
amdgpu_dm_destroy_drm_device(&adev->dm);
17381734

17391735
#if defined(CONFIG_DRM_AMD_SECURE_DISPLAY)

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,6 @@ static const struct drm_connector_helper_funcs dm_dp_mst_connector_helper_funcs
468468
static void amdgpu_dm_encoder_destroy(struct drm_encoder *encoder)
469469
{
470470
drm_encoder_cleanup(encoder);
471-
kfree(encoder);
472471
}
473472

474473
static const struct drm_encoder_funcs amdgpu_dm_encoder_funcs = {

0 commit comments

Comments
 (0)