Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3134257ybi; Thu, 18 Jul 2019 21:42:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqzYYd9qThVxotGCFBI2cJX/a/TeGfK/183RH9r8KdH/O1mFf2elmTNLx0K0pfe2VMOu0soj X-Received: by 2002:a65:68c9:: with SMTP id k9mr19709556pgt.17.1563511321981; Thu, 18 Jul 2019 21:42:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563511321; cv=none; d=google.com; s=arc-20160816; b=03xoVb3+aolrZQU3yTgwrgfm/Ld/4MiNfPK33zgqucxlqbcOci7P2cvStRmZOB30p1 r3HIMvDb8STqCeqA6avU74SXSU3f5opQ26hMk5WrU9KcKtjSoAhDmqvh+y1FwAKSJSEE PeVoSYEt3aUZJvGnm2azuvHJ0jVGJ/nS7c4kw1nQuEy5jEQWpf829Frp7VxBLsvwLWlQ /Of5P5swS1Jcl5Ew0c0gE+SBoBA6UPAuCDEDwcnbW3Du65vjNt9mkDDUiv7fCrlxKGs/ gyufPC1wRHIg/bfSFS0nzbqt5nyXUivHRLiJwKwcwhH5TIWnFHbg0tuZobtBk0nrAqAB XPUA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=lUCsWvKTljZ6ioiBmWx6BCyp8Rbr3BKP9ci5rUlewiY=; b=YEzKpgMVLkKFSdjCX8cMeg8JjhqElkDCWqY1xZPVAxJs6XXYEAHa6ds+gdyuVcypLv 8lG/FwhfK07khxGixjwamPV3Razg/YCF+/ez9BvLGPLSg5YdZj+cW3b1Rd0PG76U2BI/ O2MIRR+TUvRTcJWLPleQOZ4yj+hlyKScXb3hfm4a0fdYvxv1Eu7xAEAMgaAICiJugW6j l26ZunNW4JBnm92lpjFglp3044edlyYiiW6p3tVJbX3hGRB5JzIpIuAuBrNB5QBxZUaS Yu3hw9nYybVUYitrT781vdZB2Edj1XkWDPwJ8PMu8110QN3+V07oEfjIDbhm0I8gsYhR vb0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Lpa+A5Pq; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x190si4486235pgd.146.2019.07.18.21.41.46; Thu, 18 Jul 2019 21:42:01 -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=Lpa+A5Pq; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727559AbfGSD5u (ORCPT + 99 others); Thu, 18 Jul 2019 23:57:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:57018 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727498AbfGSD5s (ORCPT ); Thu, 18 Jul 2019 23:57:48 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CA35A2082E; Fri, 19 Jul 2019 03:57:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563508667; bh=zXuf2nbZCij5MP1OdNwHCR3+fO1/OY+Y4ixkT1Yzb0A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Lpa+A5PqUfVvmpRc4eJAQOjonsdRWvvlVWHry1X3/Sup3s+4qc0FKU4/iMfbZF1q3 fv1tGprY4O5IgRmWjabC/TIJeAd9/4/MX0xW16lvwTg+B1OpGyKtzN4HtrjahTLOab TJCvr3Jj8MK8oOeGr1v8cy23OYpvr7JKzEMeKpnM= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Felix Kuehling , =?UTF-8?q?Christian=20K=C3=B6nig?= , Harish Kasiviswanathan , Alex Deucher , Sasha Levin , dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH AUTOSEL 5.2 023/171] drm/amdgpu: Reserve shared fence for eviction fence Date: Thu, 18 Jul 2019 23:54:14 -0400 Message-Id: <20190719035643.14300-23-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190719035643.14300-1-sashal@kernel.org> References: <20190719035643.14300-1-sashal@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Felix Kuehling [ 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