mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daniel Drake <ddrake@baylibre.com>
To: Kartik Nair <contact.kartikn@gmail.com>,
	tomeu@tomeuvizoso.net, ogabbay@kernel.org
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] accel/rocket: fix ignored return value in rocket_ioctl_submit
Date: Tue, 17 Nov 2026 14:27:12 +0000	[thread overview]
Message-ID: <c000f684-0989-4ac7-bd40-e6d224fe070b@baylibre.com> (raw)
In-Reply-To: <20260510200047.6117-1-contact.kartikn@gmail.com>

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?

Then the execution of the job list could happen as a second stage, 
hopefully without any possibility of failure.

Daniel


      reply	other threads:[~2026-11-17 14:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-10 20:00 Kartik Nair
2026-11-17 14:27 ` Daniel Drake [this message]

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=c000f684-0989-4ac7-bd40-e6d224fe070b@baylibre.com \
    --to=ddrake@baylibre.com \
    --cc=contact.kartikn@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ogabbay@kernel.org \
    --cc=tomeu@tomeuvizoso.net \
    /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

all inboxes | Powered by JetHome®