From: Dan Carpenter <dan.carpenter@oracle.com>
To: andrey.grodzovsky@amd.com
Cc: dri-devel@lists.freedesktop.org
Subject: [bug report] drm/sched: Set error to s_fence if HW job submission failed.
Date: Tue, 29 Oct 2019 17:39:14 +0300 [thread overview]
Message-ID: <20191029143914.GA19410@mwanda> (raw)
Hello Andrey Grodzovsky,
The patch e91e5f080e03: "drm/sched: Set error to s_fence if HW job
submission failed." from Oct 24, 2019, leads to the following static
checker warning:
drivers/gpu/drm/scheduler/sched_main.c:500 drm_sched_resubmit_jobs()
warn: passing zero to 'PTR_ERR'
drivers/gpu/drm/scheduler/sched_main.c
477 void drm_sched_resubmit_jobs(struct drm_gpu_scheduler *sched)
478 {
479 struct drm_sched_job *s_job, *tmp;
480 uint64_t guilty_context;
481 bool found_guilty = false;
482 struct dma_fence *fence;
483
484 list_for_each_entry_safe(s_job, tmp, &sched->ring_mirror_list, node) {
485 struct drm_sched_fence *s_fence = s_job->s_fence;
486
487 if (!found_guilty && atomic_read(&s_job->karma) > sched->hang_limit) {
488 found_guilty = true;
489 guilty_context = s_job->s_fence->scheduled.context;
490 }
491
492 if (found_guilty && s_job->s_fence->scheduled.context == guilty_context)
493 dma_fence_set_error(&s_fence->finished, -ECANCELED);
494
495 dma_fence_put(s_job->s_fence->parent);
496 fence = sched->ops->run_job(s_job);
497
498 if (IS_ERR_OR_NULL(fence)) {
^^^^^^^^^^^^^^^^^^^^
499 s_job->s_fence->parent = NULL;
500 dma_fence_set_error(&s_fence->finished, PTR_ERR(fence));
^^^^^^^^^^^^^^
If "fence" is NULL then it triggers a WARN_ON() inside the
dma_fence_set_error() function.
WARN_ON(error >= 0 || error < -MAX_ERRNO);
^^^^^^^^^^
501 } else {
502 s_job->s_fence->parent = fence;
503 }
504
505
506 }
507 }
regards,
dan carpenter
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next reply other threads:[~2019-10-29 14:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-29 14:39 Dan Carpenter [this message]
2019-10-29 14:41 ` [bug report] drm/sched: Set error to s_fence if HW job submission failed Dan Carpenter
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=20191029143914.GA19410@mwanda \
--to=dan.carpenter@oracle.com \
--cc=andrey.grodzovsky@amd.com \
--cc=dri-devel@lists.freedesktop.org \
/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.