This is a note to let you know that I've just added the patch titled drm/amd/display: Don't lock connection_mutex for DMUB HPD to the 5.15-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: drm-amd-display-don-t-lock-connection_mutex-for-dmub-hpd.patch and it can be found in the queue-5.15 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From d82b3266ef88dc10fe0e7031b2bd8ba7eedb7e59 Mon Sep 17 00:00:00 2001 From: Nicholas Kazlauskas <nicholas.kazlauskas@xxxxxxx> Date: Thu, 4 Nov 2021 16:52:06 -0400 Subject: drm/amd/display: Don't lock connection_mutex for DMUB HPD From: Nicholas Kazlauskas <nicholas.kazlauskas@xxxxxxx> commit d82b3266ef88dc10fe0e7031b2bd8ba7eedb7e59 upstream. [Why] Per DRM spec we only need to hold that lock when touching connector->state - which we do not do in that handler. Taking this locking introduces unnecessary dependencies with other threads which is bad for performance and opens up the potential for a deadlock since there are multiple locks being held at once. [How] Remove the connection_mutex lock/unlock routine and just iterate over the drm connectors normally. The iter helpers implicitly lock the connection list so this is safe to do. DC link access also does not need to be guarded since the link table is static at creation - we don't dynamically add or remove links, just streams. Fixes: e27c41d5b068 ("drm/amd/display: Support for DMUB HPD interrupt handling") Reviewed-by: Jude Shih <shenshih@xxxxxxx> Acked-by: Anson Jacob <Anson.Jacob@xxxxxxx> Tested-by: Daniel Wheeler <daniel.wheeler@xxxxxxx> Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@xxxxxxx> Signed-off-by: Alex Deucher <alexander.deucher@xxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 ---- 1 file changed, 4 deletions(-) --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -668,10 +668,7 @@ void dmub_hpd_callback(struct amdgpu_dev return; } - drm_modeset_lock(&dev->mode_config.connection_mutex, NULL); - link_index = notify->link_index; - link = adev->dm.dc->links[link_index]; drm_connector_list_iter_begin(dev, &iter); @@ -684,7 +681,6 @@ void dmub_hpd_callback(struct amdgpu_dev } } drm_connector_list_iter_end(&iter); - drm_modeset_unlock(&dev->mode_config.connection_mutex); } Patches currently in stable-queue which might be from nicholas.kazlauskas@xxxxxxx are queue-5.15/drm-amd-display-reset-dmcub-before-hw-init.patch queue-5.15/drm-amd-display-don-t-lock-connection_mutex-for-dmub-hpd.patch queue-5.15/drm-amd-display-fix-surface-optimization-regression-on-carrizo.patch queue-5.15/drm-amd-display-add-option-to-defer-works-of-hpd_rx_.patch queue-5.15/drm-amd-display-optimize-bandwidth-on-following-fast-update.patch