From: jsg Date: Mon, 6 Mar 2023 02:40:58 +0000 (+0000) Subject: drm/amd/display: Properly reuse completion structure X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=276e652ae50ca1a186be0a1b234901c4057ff9bb;p=openbsd drm/amd/display: Properly reuse completion structure From Stylon Wang 118ad80d27d938868299ef184f7483b21f011f0b in linux-6.1.y/6.1.15 0cf8307adbc6beb5ff3b8a76afedc6e4e0b536a9 in mainline linux --- diff --git a/sys/dev/pci/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/sys/dev/pci/drm/amd/display/amdgpu_dm/amdgpu_dm.c index e08b0556d99..0f6d9ba64f0 100644 --- a/sys/dev/pci/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/sys/dev/pci/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -10256,6 +10256,7 @@ int amdgpu_dm_process_dmub_aux_transfer_sync( ret = p_notify->aux_reply.length; *operation_result = p_notify->result; out: + reinit_completion(&adev->dm.dmub_aux_transfer_done); mutex_unlock(&adev->dm.dpia_aux_lock); return ret; } @@ -10283,6 +10284,8 @@ int amdgpu_dm_process_dmub_set_config_sync( *operation_result = SET_CONFIG_UNKNOWN_ERROR; } + if (!is_cmd_complete) + reinit_completion(&adev->dm.dmub_aux_transfer_done); mutex_unlock(&adev->dm.dpia_aux_lock); return ret; }