]> git.ipfire.org Git - thirdparty/linux.git/commit
accel: ethosu: Fix job submit error clean-up refcount underflows
authorRob Herring (Arm) <robh@kernel.org>
Wed, 18 Feb 2026 22:21:55 +0000 (16:21 -0600)
committerRob Herring (Arm) <robh@kernel.org>
Thu, 5 Mar 2026 21:21:17 +0000 (15:21 -0600)
commit150bceb3e0a4a30950279d91ea0e8cc69a736742
treea0aea57285e630ca9665421e8bdec9015160a034
parentd5b8b0347fa8470b751a506fb801797e271d7548
accel: ethosu: Fix job submit error clean-up refcount underflows

If the job submit fails before adding the job to the scheduler queue
such as when the GEM buffer bounds checks fail, then doing a
ethosu_job_put() results in a pm_runtime_put_autosuspend() without the
corresponding pm_runtime_resume_and_get(). The dma_fence_put()'s are
also unnecessary, but seem to be harmless.

Split the ethosu_job_cleanup() function into 2 parts for the before
and after the job is queued.

Fixes: 5a5e9c0228e6 ("accel: Add Arm Ethos-U NPU driver")
Reviewed-and-Tested-by: Anders Roxell <anders.roxell@linaro.org>
Link: https://patch.msgid.link/20260218-ethos-fixes-v1-1-be3fa3ea9a30@kernel.org
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
drivers/accel/ethosu/ethosu_job.c