Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3796878ybi; Mon, 29 Jul 2019 12:48:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqzHNKpnwCenPqikKFPlnbmQJ/WBROfwO2ZMJmLvwM+ipoPiHIAelIHLQ+gh+USucGfrZS0+ X-Received: by 2002:a17:902:b20c:: with SMTP id t12mr112565637plr.285.1564429726622; Mon, 29 Jul 2019 12:48:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564429726; cv=none; d=google.com; s=arc-20160816; b=BKutImxSHFD6f353fNj0ueyfx+sYrEb2dtYSvjsG0TYkQrilgsiYrETgRyKK8Z9+/Q VpXsocFcPxgtIzc3wqA9jl5GPzym+rZL73yhMhTbNShb90kH5BuYp8gOj2EdgLSZbL6l eY8GkxhVnh0yhA4P7Y00McBo5buu+qw7I+T2zvfxPpAFT0AuDfBNrmuv//Dkkwu7IYOL 7mjhpqgno6F1IfZ6WmrWjp3//vsOBsjnpLk7BKooZ/2atVtKjKVjELNeczVeLFSq8fm8 NOBsoKc/0VSV5AeyFsM7dwi91nDx6o6K766OJeQMf4baw4qGRaf0ys/GRyJj325nT0AF BpWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=gxcNbsu4OYgRLgk9lMDgQcB+FSK24gn+EDh+928MVyQ=; b=Emm2OZDOO//pHr8CUKUDOMSeuhDHDaAy/v9dzMQFubfZZLiJlifWjI8Ez80g4PyfH6 fU06sxhXlNXLH7sXnnHlxZKEAHe598fGYZkG6WXL4lQk4n9259+wU6JQTvTzVTCNZxTX aR4OwA/MnZ8cKX7FDel1Nh5E1LQ62WaCYy1FD1ajcVJkAB/NZWa74MvIweyis8b5yl3H /XuIRzCfbIx8d93zHoR0Jb5zFKeQxjwXzCpeo9tykJX2ZYNMfuwzx6/C3VuOSGHbtPzS sSDOTZVxInF0RvqB4fWo21t1189v32JaunwDTV1SePI2Dih1mryLTF0v8nQ03KI8OLEi EgpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=gYHxO5pL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r129si29306552pgr.21.2019.07.29.12.48.32; Mon, 29 Jul 2019 12:48:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=gYHxO5pL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389768AbfG2TqM (ORCPT + 99 others); Mon, 29 Jul 2019 15:46:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:35282 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390098AbfG2TqJ (ORCPT ); Mon, 29 Jul 2019 15:46:09 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6AB9B21655; Mon, 29 Jul 2019 19:46:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564429569; bh=MvNMOkezmcVB2765TDn/hRcjd4x9ipr+ymUwktuan7M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gYHxO5pLXu+jF4PbAihcWeNFcZHK37rvDYZbX69KoN+22fET0dkPDb6uI809engP4 JcWoyLwKD5bO+DsOY16LTP6N34zpm3rN2rCkgc7T5BFS+YGxVgrVMaRdd3umyCRcNH VaLA+5QBetwx1MZeQMYHCchMHtiF4KvBhDvadHms= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Felix Kuehling , =?UTF-8?q?Christian=20K=C3=B6nig?= , Harish Kasiviswanathan , Alex Deucher , Sasha Levin Subject: [PATCH 5.2 025/215] drm/amdgpu: Reserve shared fence for eviction fence Date: Mon, 29 Jul 2019 21:20:21 +0200 Message-Id: <20190729190744.332250061@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190729190739.971253303@linuxfoundation.org> References: <20190729190739.971253303@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit dd68722c427d5b33420dce0ed0c44b4881e0a416 ] Need to reserve space for the shared eviction fence when initializing a KFD VM. Signed-off-by: Felix Kuehling Acked-by: Christian König Reviewed-by: Harish Kasiviswanathan Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c index a6e5184d436c..4b192e0ce92f 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c @@ -896,6 +896,9 @@ static int init_kfd_vm(struct amdgpu_vm *vm, void **process_info, AMDGPU_FENCE_OWNER_KFD, false); if (ret) goto wait_pd_fail; + ret = reservation_object_reserve_shared(vm->root.base.bo->tbo.resv, 1); + if (ret) + goto reserve_shared_fail; amdgpu_bo_fence(vm->root.base.bo, &vm->process_info->eviction_fence->base, true); amdgpu_bo_unreserve(vm->root.base.bo); @@ -909,6 +912,7 @@ static int init_kfd_vm(struct amdgpu_vm *vm, void **process_info, return 0; +reserve_shared_fail: wait_pd_fail: validate_pd_fail: amdgpu_bo_unreserve(vm->root.base.bo); -- 2.20.1