Re: [PATCH 2/2] drm/nouveau: Fix double call to drm_sched_entity_fini()

M Henning
2026-04-14T18:49:07Z

On Tue, Apr 14, 2026 at 9:38 AM Philipp Stanner <phasta@kernel.org> wrote:
>
> nouveau_abi16_chan_fini() does invoke drm_sched_entity_fini() twice:
> Once directly, and a second time through nouveau_sched_destroy().
>
> That's likely undesired behavior and might be a bug since
> drm_sched_entity_fini() decrements reference counts.
>
> Fix the issue by using the appropriate function,
> drm_sched_entity_flush(), to ensure that the entity becomes idle.

Your commit message says drm_sched_entity_flush but the commit uses
drm_sched_entity_kill.

> Cc: stable@kernel.vger.org
> Fixes: 9a0c32d698c1 ("drm/nouveau: don't fini scheduler if not initialized")
> Suggested-by: Danilo Krummrich <dakr@kernel.org>
> Signed-off-by: Philipp Stanner <phasta@kernel.org>
> ---
> drivers/gpu/drm/nouveau/nouveau_abi16.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/nouveau/nouveau_abi16.c b/drivers/gpu/drm/nouveau/nouveau_abi16.c
> index 7860877d909b..291203121f0c 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_abi16.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_abi16.c
> @@ -176,7 +176,7 @@ nouveau_abi16_chan_fini(struct nouveau_abi16 *abi16,
>
> /* Cancel all jobs from the entity's queue. */
> if (chan->sched)
> - drm_sched_entity_fini(&chan->sched->entity);
> + drm_sched_entity_kill(&chan->sched->entity);
>
> if (chan->chan)
> nouveau_channel_idle(chan->chan);
> --
> 2.49.0
>