Re: [PATCH] drm/imagination: Propagate all errors from KCCB command submission code

From: Alessio Belle

Date: Wed Sep 02 2026 - 14:17:54 EST


Hi Zhan,

On Tue, 2026-08-11 at 14:30 +0800, Zhan Xusheng wrote:
> On Tue, 11 Aug 2026 09:11:54 +0300, Alexandru Dadu wrote:
> > - WARN_ON(pvr_dev->lost);
> > + if (pvr_dev->lost)
> > + return -EIO;
>
> kccb.reserved_count is only decremented further down, past both WARN_ON()s,
> so this returns with the slot pvr_queue_prepare_job() reserved still held.
>
> That path keeps being taken: pvr_power_reset()'s err_device_lost still calls
> pvr_queue_device_post_reset(), which starts every queue again, so jobs go on

This behaviour post device lost sounds like something we should investigate.
Thanks for pointing this (and the rest) out!

Alessio

> reaching run_job() after the device is lost. Each one then leaks a
> reservation, and pvr_kccb_fini() ends on
>
> WARN_ON(pvr_dev->kccb.reserved_count);
>
> pvr_kccb_release_slot() is meant for this ("Should only be called if
> something failed after the pvr_kccb_reserve_slot() call"), but it has no
> callers yet, so the ERR_PTR returns already in pvr_queue_run_job() lose the
> reservation the same way. Might be worth handling in one place.
>
> Thanks,
> Zhan Xusheng