drm/amd/display: fix issues with driver unload
Subsystems (3)
PATCH 1/1 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() in 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 allocater.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 ---- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 1 - 2 files changed, 5 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -4
@@ -1733,10 +1733,6 @@ static void amdgpu_dm_fini(struct amdgpu_device *adev) adev->dm.vblank_control_workqueue =NULL ; } -for (i =0 ; i < adev->dm.display_indexes_num; i++) { -drm_encoder_cleanup (&adev->dm.mst_encoders[i].base); - } -amdgpu_dm_destroy_drm_device (&adev->dm);#if defined(CONFIG_DRM_AMD_SECURE_DISPLAY )
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c +0 -1
@@ -492,7 +492,6 @@ static const struct drm_connector_helper_funcs dm_dp_mst_connector_helper_funcsstatic void amdgpu_dm_encoder_destroy (struct drm_encoder *encoder) {drm_encoder_cleanup (encoder); -kfree (encoder); }static const struct drm_encoder_funcs amdgpu_dm_encoder_funcs = {
Signature · 1 line
2.39.0
Quoted 11 lines · Hamza Mahfooz
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 callingdrm_encoder_cleanup()inamdgpu_dm_fini()and instead have it be called fromamdgpu_dm_encoder_destroy(). Also, we don't need to free inamdgpu_dm_encoder_destroy()since mst_encoders[] isn't explicitly allocated by the slab allocater.Fixes f74367e492ba ("drm/amdgpu/display: create fake mst encoders ahead of time (v4)")Signed-off-by Hamza Mahfooz <[email protected]>
Quoted 35 lines
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 ---- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 1 - 2 files changed, 5 deletions(-)drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0
-4@@ -1733,10 +1733,6 @@ static void amdgpu_dm_fini(struct amdgpu_device *adev) adev->dm.vblank_control_workqueue =NULL ; } -for (i =0 ; i < adev->dm.display_indexes_num; i++) { -drm_encoder_cleanup (&adev->dm.mst_encoders[i].base); - } -amdgpu_dm_destroy_drm_device (&adev->dm);#if defined(CONFIG_DRM_AMD_SECURE_DISPLAY )drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c +0
-2@@ -492,7 +492,6 @@ static const struct drm_connector_helper_funcs dm_dp_mst_connector_helper_funcsstatic void amdgpu_dm_encoder_destroy (struct drm_encoder *encoder) {drm_encoder_cleanup (encoder); -kfree (encoder); }static const struct drm_encoder_funcs amdgpu_dm_encoder_funcs = { --2.39.0