From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1B2F53C2F; Wed, 21 Feb 2024 13:39:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708522777; cv=none; b=DQpWbV0n2S4bTKeqDJF+xsl8PFrB5jP/w2hWC07FPzNNB3fYNI3sb8yEjzLOpRC6fF4smPYHPzKrBFOMLo56i4DGbn42VhsQ5IV/Agjh18y15R2SH/EMN4SHHXH+8VDpqPRDIIU289tv6nBx/3xqdrdfY/tCXxpkqo01gpITWyU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708522777; c=relaxed/simple; bh=1zIsFN+SiP3WylpfTfxf9m5Wk44HK7d7U98zXoyu/20=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=TCqSktzmTVlss9Vr3JaOTFdY/o+0BJn9ktYRiZawEZGXZ3GsaNgZVWFhm313Vbb9JFqHWubgN2li5WIBV37WiyWhfLifcJEH1qiG5Al++WI74o6KT+gZMQvB01mewsySX7kvG8XBBAJla33jclfRBK6Uz0/k8YfhBgiqvnC+v4g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=fNc/mn1x; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="fNc/mn1x" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 237D4C433F1; Wed, 21 Feb 2024 13:39:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1708522776; bh=1zIsFN+SiP3WylpfTfxf9m5Wk44HK7d7U98zXoyu/20=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fNc/mn1x/I19PkzSvkYlWj08nRCTFJN7YOQsWWNJrv2vmLNBzel+TmZ0nXKFJxdTc piMFy7hDV4SPg++ht6NmGR2eCvemg7XMkBibvklHvpe/H7yVk+HHxwBmH+6zySlWra LrcWQcVz1zeYG2nxr27/nuqLh3+swH5TupTigFCI= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Felix Kuehling , =?UTF-8?q?Christian=20K=C3=B6nig?= , Alex Deucher , Sasha Levin Subject: [PATCH 5.15 237/476] drm/amdgpu: Let KFD sync with VM fences Date: Wed, 21 Feb 2024 14:04:48 +0100 Message-ID: <20240221130016.649207409@linuxfoundation.org> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240221130007.738356493@linuxfoundation.org> References: <20240221130007.738356493@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Felix Kuehling [ Upstream commit ec9ba4821fa52b5efdbc4cdf0a77497990655231 ] Change the rules for amdgpu_sync_resv to let KFD synchronize with VM fences on page table reservations. This fixes intermittent memory corruption after evictions when using amdgpu_vm_handle_moved to update page tables for VM mappings managed through render nodes. Signed-off-by: Felix Kuehling Reviewed-by: Christian König Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c index 862eb3c1c4c5..494466893486 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c @@ -208,7 +208,8 @@ static bool amdgpu_sync_test_fence(struct amdgpu_device *adev, /* Never sync to VM updates either. */ if (fence_owner == AMDGPU_FENCE_OWNER_VM && - owner != AMDGPU_FENCE_OWNER_UNDEFINED) + owner != AMDGPU_FENCE_OWNER_UNDEFINED && + owner != AMDGPU_FENCE_OWNER_KFD) return false; /* Ignore fences depending on the sync mode */ -- 2.43.0