Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp6567140ybx; Mon, 11 Nov 2019 11:04:43 -0800 (PST) X-Google-Smtp-Source: APXvYqw8xA1PXno4/jpURNWcwHXKkD4PyLKVTK1mwuVZzdK09omFTdZHYoIod/VYmpqr8vQQG3qQ X-Received: by 2002:a50:f699:: with SMTP id d25mr27776472edn.72.1573499083653; Mon, 11 Nov 2019 11:04:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573499083; cv=none; d=google.com; s=arc-20160816; b=i0whQjs2VKTvkp+H/DblCxXifFIW9qamgm8M8kaCl2zI31SukkU0gRKBpB+qRRPWY6 RAiaK8SQ04MsIhDtBR5RHhBjXe7r/igdGGA+rnsdLYqzpo+DDfuFm1P7OYAjDY3Qhv6d CkiVdctRVcedkIzK99JgwnQJn0EKrGN0m8/WUvQCtHUWRhtERUTly+KKI8ryoaPEEtLt WBSVHQ3jCa92oCh3MSmPUUU79dESE5JjPsISm5QkCSdzQRjimyr65qEMqkWSyCL5q4ty xTVjYLkwkU8f4mLK5Oy1Oojhdp0vpkP7UrzPMCHvKbPJx419aBKIrLk9v0iE0vK6FKGc L8lQ== 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=xhpB1d4k9QEY0s60wkezOGhp3935KMy6ro+Eop0FCFk=; b=NIiPxeT52dbz5uLY/ms8D7hkLJX2M6G07YqGNL7+1v4UtZzs8hGyhR16bB1pOxeLsP Y+32WHF4YUsunISnFq8xDXEmngIblDEBewc07M3WmPrAKM0/63Y7JW5X/TAR82An823t dmPh2b/xWntuldNtA8Q+xlD7wgElAdtTBsjFPSYTHg3cZhVkssM8+t/ifFo7pFnBt3so s1E47on7YHWr9gxeJecj27eunPGu017giyPHNHEEyLIOFm8hMnH20Fi0TnHp8BrD/Tg1 jX9x9lGocGog1kP4lBW8++8Dxg6P9CYIGUIt8RobrUCwePGwZq4klddxH3RSLXHY1HNw iVZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=SqefyO1N; 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 ch17si10197112ejb.184.2019.11.11.11.04.17; Mon, 11 Nov 2019 11:04:43 -0800 (PST) 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=SqefyO1N; 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 S1729965AbfKKSqM (ORCPT + 99 others); Mon, 11 Nov 2019 13:46:12 -0500 Received: from mail.kernel.org ([198.145.29.99]:38602 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729557AbfKKSqL (ORCPT ); Mon, 11 Nov 2019 13:46:11 -0500 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 8761E20659; Mon, 11 Nov 2019 18:46:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573497970; bh=E1CbWjVkJG8PYQL/0BKtViHj53nuYKi+UegmnxcQ47g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SqefyO1N02Fx9MLCfr2CgIzhGftC/mJr8tizsvSLg5ULIEsMqMvJFj8AEd2pr+0qU +sorQbUdYDPXGSa4/9uA+Y9FFrfARhNSC+xkObvcGhH9OlGEmKD8T+oQDBJytCGc0Q sS+BSqVyEql70C4CBxwdggMo7JycuObFsbM/NlKM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andrey Grodzovsky , =?UTF-8?q?Christian=20K=C3=B6nig?= , Alex Deucher , Sasha Levin Subject: [PATCH 4.19 110/125] drm/amdgpu: If amdgpu_ib_schedule fails return back the error. Date: Mon, 11 Nov 2019 19:29:09 +0100 Message-Id: <20191111181454.505362132@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191111181438.945353076@linuxfoundation.org> References: <20191111181438.945353076@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 From: Andrey Grodzovsky [ Upstream commit 57c0f58e9f562089de5f0b60da103677d232374c ] Use ERR_PTR to return back the error happened during amdgpu_ib_schedule. Signed-off-by: Andrey Grodzovsky Reviewed-by: Christian König Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c index f823d4baf044d..cf582cc46d53e 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c @@ -203,7 +203,7 @@ static struct dma_fence *amdgpu_job_run(struct drm_sched_job *sched_job) struct amdgpu_ring *ring = to_amdgpu_ring(sched_job->sched); struct dma_fence *fence = NULL, *finished; struct amdgpu_job *job; - int r; + int r = 0; job = to_amdgpu_job(sched_job); finished = &job->base.s_fence->finished; @@ -228,6 +228,8 @@ static struct dma_fence *amdgpu_job_run(struct drm_sched_job *sched_job) job->fence = dma_fence_get(fence); amdgpu_job_free_resources(job); + + fence = r ? ERR_PTR(r) : fence; return fence; } -- 2.20.1