Return-Path: Received: from mail-by2on0066.outbound.protection.outlook.com ([207.46.100.66]:52992 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754819AbbLGLqa convert rfc822-to-8bit (ORCPT ); Mon, 7 Dec 2015 06:46:30 -0500 Received: from satlvexedge01.amd.com (satlvexedge01.amd.com [10.177.96.28]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by atltwp01.amd.com (Axway MailGate 5.3.1) with ESMTPS id 2BEA5CAF301 for ; Mon, 7 Dec 2015 04:13:32 -0500 (EST) From: Chunming Zhou To: CC: , Chunming Zhou Subject: [PATCH] drm/amdgpu: fix the lost duplicates checking Date: Mon, 7 Dec 2015 17:08:13 +0800 Message-ID: <1449479293-21830-1-git-send-email-David1.Zhou@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Sender: stable-owner@vger.kernel.org List-ID: Change-Id: I657039670b2c022ac461f14094cd909b10c1a2a8 Signed-off-by: Chunming Zhou Reviewed-by: Christian König Reviewed-by: Jammy Zhou --- drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c index e461357..07b1ddf 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c @@ -535,6 +535,14 @@ static void amdgpu_gem_va_update_vm(struct amdgpu_device *adev, if (domain == AMDGPU_GEM_DOMAIN_CPU) goto error_unreserve; } + list_for_each_entry(entry, &duplicates, head) { + domain = amdgpu_mem_type_to_domain(entry->bo->mem.mem_type); + /* if anything is swapped out don't swap it in here, + just abort and wait for the next CS */ + if (domain == AMDGPU_GEM_DOMAIN_CPU) + goto error_unreserve; + } + r = amdgpu_vm_update_page_directory(adev, bo_va->vm); if (r) goto error_unreserve; -- 1.9.1