From 9355ae92f2c00514d0c3d12d20843e84bab7ee9d Mon Sep 17 00:00:00 2001 From: Mukul Joshi Date: Tue, 18 Aug 2026 15:07:19 -0400 Subject: [PATCH] drm/amdgpu: Fix missed connection cleanup on HELLO reset for UALink When a HELLO arrived on an already ESTABLISHED connection, amdgpu_ualink_process_hello_msg() set the state to PENDING before calling amdgpu_ualink_handle_connection_reset(). That function only runs the imp/exp XA cleanup when it observes the state as ESTABLISHED, so the premature change skipped the cleanup and left stale NPA mappings and pinned BOs from the previous connection. Leave the state as ESTABLISHED and let amdgpu_ualink_handle_connection_reset() perform the transition, so the cleanup runs. Signed-off-by: Mukul Joshi Reviewed-by: Harish Kasiviswanathan Reviewed-by : Philip Yang Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c index ab564202f550..f4a4432c2c5d 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c @@ -2270,11 +2270,9 @@ static void amdgpu_ualink_process_hello_msg(struct amdgpu_device *adev, /* otherwise, leave it IN_PROGRESS to signal the completion below */ mutex_unlock(&conn_state->lock); } else { - /* Set the connection state back to In Progress and revoke - * all exports and release all imports corresponding to the - * sender GPU. + /* Leave state ESTABLISHED so handle_connection_reset() + * performs the transition and imp/exp XA cleanup. */ - conn_state->state = AMDGPU_UALINK_CONN_PENDING; generation_count = conn_state->generation_count; mutex_unlock(&conn_state->lock);