dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: MoGGuU <Naixumogu@whut.edu.cn>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v3 3/3] accel/rocket: Propagate job submission errors
Date: Fri, 28 Aug 2026 05:19:26 +0000	[thread overview]
Message-ID: <20260828051926.C73101F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260828050805.38548-4-Naixumogu@whut.edu.cn>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Unrecoverable partial job submission due to missing progress reporting.
--

commit 62a6d62ce92d524109acbfd3cf943820e07879c2
Author: MoGGuU <Naixumogu@whut.edu.cn>

accel/rocket: Propagate job submission errors

This commit updates rocket_ioctl_submit() to return the first error
encountered during job submission and stop processing remaining jobs.
Previously, errors from individual job submissions were ignored.

> diff --git a/drivers/accel/rocket/rocket_job.c b/drivers/accel/rocket/rocket_job.c
> index b55e12aecfe64..8f1bdf4a57f20 100644
> --- a/drivers/accel/rocket/rocket_job.c
> +++ b/drivers/accel/rocket/rocket_job.c
> @@ -646,8 +646,11 @@ int rocket_ioctl_submit(struct drm_device *dev, void *data, struct drm_file *fil
>  	}
>  
> -	for (i = 0; i < args->job_count; i++)
> -		rocket_ioctl_submit_job(dev, file, &jobs[i]);
> +	for (i = 0; i < args->job_count; i++) {
> +		ret = rocket_ioctl_submit_job(dev, file, &jobs[i]);
> +		if (ret)
> +			goto exit;
> +	}
>  
>  exit:
>  	kvfree(jobs);

[Severity: High]
How does userspace determine how many jobs were successfully submitted before
the error occurred?

When rocket_ioctl_submit() halts on the first error, the previously submitted 
jobs remain queued, giving ordered partial-submit semantics. However, looking
at the UAPI struct drm_rocket_submit in include/uapi/drm/rocket_accel.h:

struct drm_rocket_submit {
        __u64 jobs;
        __u32 job_count;
        __u32 job_struct_size;
        __u64 reserved;
};

There is no output field (like jobs_submitted) to communicate the partial
success state back to userspace, and the kernel does not modify the incoming
job_count.

Without knowing the index of the failed job, if a user application encounters
an error (for example, due to an invalid BO handle or memory allocation
failure), how can it safely recover? 

If userspace retries the submission, it risks double-submitting already
queued jobs, which can corrupt hardware state. If it aborts entirely, it may
hang waiting for implicit fences on BOs that were successfully submitted.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260828050805.38548-1-Naixumogu@whut.edu.cn?part=3

  reply	other threads:[~2026-08-28  5:19 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-28  5:08 [PATCH v3 0/3] accel/rocket: Fix job submit error handling MoGGuU
2026-08-28  5:08 ` [PATCH v3 1/3] accel/rocket: Validate BO handle counts on job submission MoGGuU
2026-08-28  5:25   ` sashiko-bot
2026-08-28  5:44   ` Sidong Yang
2026-08-28  5:08 ` [PATCH v3 2/3] accel/rocket: Collect job dependencies before arming MoGGuU
2026-08-28  5:22   ` sashiko-bot
2026-08-28  5:46   ` Sidong Yang
2026-08-28  5:50     ` Sidong Yang
2026-08-28  5:08 ` [PATCH v3 3/3] accel/rocket: Propagate job submission errors MoGGuU
2026-08-28  5:19   ` sashiko-bot [this message]
2026-08-28  5:47   ` Sidong Yang

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=20260828051926.C73101F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=Naixumogu@whut.edu.cn \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox