Re: [PATCH] accel/rocket: fix ignored return value in rocket_ioctl_submit
From: Gyeyoung Baek
Date: Tue Nov 17 2026 - 22:23:19 EST
Hi,
On Tue, Nov 17, 2026 at 11:27 PM Daniel Drake <ddrake@xxxxxxxxxxxx> wrote:
>
> Hi,
>
> On 10/05/2026 21:00, Kartik Nair wrote:
> > rocket_ioctl_submit() calls rocket_ioctl_submit_job() in a loop but
> > ignores its return value. If any job submission fails, the error is
> > silently dropped and the function returns 0 (success) to userspace,
> > leaving subsequent jobs potentially in an inconsistent state.
> >
> > Fix this by propagating the error and breaking out of the loop on
> > the first failure.
>
> There's definitely a bug in there, but this approach is just replacing
> one incorrect behaviour with another.
>
> After your change if there is an -EINTR generated from within the job
> submission, this will cause drmIoctl to retry the exact same job
> sequence, likely causing parts of the sequence to be repeated, possibly
> with negative consequences.
>
> And on other error paths that would be bubbled up by your change,
> userspace won't be able to know which parts of the sequence ran vs failed.
>
> I think we need a deeper change here. Is it possible to fully prepare
> and arm the whole job list first, without executing yet, returning an
> error code if anything goes wrong in the process?
I agree with Daniel.
How about splitting rocket_ioctl_submit_job() into a prepare step
(everything that can fail) and an arm + push step,
and first preparing all jobs to check for errors?
--
Thanks,
Gyeyoung