All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lucas Stach <l.stach@pengutronix.de>
To: "Alex Deucher" <alexander.deucher@amd.com>,
	"Andrey Grodzovsky" <andrey.grodzovsky@amd.com>,
	"Christian König" <christian.koenig@amd.com>
Cc: kernel@pengutronix.de, dri-devel@lists.freedesktop.org,
	patchwork-lst@pengutronix.de
Subject: [PATCH 1/2] drm/sched: don't try to construct error code from NULL ptr
Date: Fri, 29 Nov 2019 14:26:42 +0100	[thread overview]
Message-ID: <20191129132643.7828-1-l.stach@pengutronix.de> (raw)

If the job submission fails with a NULL fence returned instead of an
error pointer we must not try to convert this into an error. The error
code in this case will be 0, which causes a warning splat from
dma_fence_set_error().

Also most drivers return NULL from the run_job callback if the fence
already has the error state set, so trying to set a 0 error code
actively destroys the valid error code on the fence.

Fixes: 167bf96014a0 (drm/sched: Set error to s_fence if HW job
       submission failed.)
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
---
 drivers/gpu/drm/scheduler/sched_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/scheduler/sched_main.c b/drivers/gpu/drm/scheduler/sched_main.c
index f39b97ed4ade..596a28d90e5c 100644
--- a/drivers/gpu/drm/scheduler/sched_main.c
+++ b/drivers/gpu/drm/scheduler/sched_main.c
@@ -495,7 +495,7 @@ void drm_sched_resubmit_jobs(struct drm_gpu_scheduler *sched)
 		dma_fence_put(s_job->s_fence->parent);
 		fence = sched->ops->run_job(s_job);
 
-		if (IS_ERR_OR_NULL(fence)) {
+		if (IS_ERR(fence)) {
 			s_job->s_fence->parent = NULL;
 			dma_fence_set_error(&s_fence->finished, PTR_ERR(fence));
 		} else {
-- 
2.20.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

             reply	other threads:[~2019-11-29 13:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-29 13:26 Lucas Stach [this message]
2019-11-29 13:26 ` [PATCH 2/2] drm/sched: remove superfluous whitespace in drm_sched_resubmit_jobs Lucas Stach
2019-11-29 18:31   ` Christian König
2019-11-29 14:11 ` [PATCH 1/2] drm/sched: don't try to construct error code from NULL ptr Steven Price

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191129132643.7828-1-l.stach@pengutronix.de \
    --to=l.stach@pengutronix.de \
    --cc=alexander.deucher@amd.com \
    --cc=andrey.grodzovsky@amd.com \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kernel@pengutronix.de \
    --cc=patchwork-lst@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.