From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 17A062C1595 for ; Wed, 15 Apr 2026 14:50:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776264616; cv=none; b=XUKqlPmVpQQvbebW5qG9TTW5LpXImQhSfR0+s0T2jrULJ2zWhz0NTuVakY0An04KrE9q9ZWCGLZaLL4y3cVK15jJy2l/hgLgeyZnutxUHrNk3udkLJq2biHjKhIy6aEeSVQr+cHWvaRIr7HuOXcqvRLtWbDzTcx7XDIGyjTVS64= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776264616; c=relaxed/simple; bh=6+yxKnNGGhecpmezEx7/XdS6MBkimFgFRi3mEAypiVo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XBrnXWp8o9MAAHSrfvS9agHryyj+O4s/nc3VrExeM4QOMsAurdSCTMiJbWj2WfB+SYL7tNxoD7F7gCVngVxRNFc21/ZyqvWXkBEOGwzWjXP1W5Acgo4E/yf6qDt9Eqgb6braQWgZn7CiCqiXPBNiT3gFga6QRMKJ0899WQUrFwY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Npmb+p4u; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Npmb+p4u" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CB378C2BCB3; Wed, 15 Apr 2026 14:50:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1776264615; bh=6+yxKnNGGhecpmezEx7/XdS6MBkimFgFRi3mEAypiVo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Npmb+p4uVMIZCdV/T3zYw6MCZk5fcxondB+Jov2zQfMn8+AVhQa/ftu4spz5pjaup WQyKFBB5LhneQqfq29qx5UdDUKTltHF8JxFD30JhVgPulUGcY9erhKExIlyoTJ0o6x O4TkT4abMWhyJyZ+EfbbWrGan5y9rRnJLpK7r+I4+VxZR+6xWVjUhyMTTshwx01CTS iS87RM/zwnmoLKzfqcntNc3PJZdMu0JRPQ4mqi0tCz/dd0vURESP6ZptHGrM+qhNfU TzEKcEH/7uvmemGk4PVbq9SkaKDlm+nCWQ9vcEVOzAHDDTz4P9DAekBWrCuX2BQGVP JJKmF5N+PiYBA== From: Philipp Stanner To: Lyude Paul , Danilo Krummrich , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Matthew Brost , Philipp Stanner , =?UTF-8?q?Christian=20K=C3=B6nig?= , Dave Airlie , Tvrtko Ursulin Cc: dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org, linux-kernel@vger.kernel.org, stable@kernel.vger.org Subject: [PATCH v2 2/2] drm/nouveau: Fix double call to drm_sched_entity_fini() Date: Wed, 15 Apr 2026 16:49:57 +0200 Message-ID: <20260415144956.272506-3-phasta@kernel.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20260415144956.272506-2-phasta@kernel.org> References: <20260415144956.272506-2-phasta@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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_kill(), to kill all remaining jobs within the entity. Cc: stable@kernel.vger.org Fixes: 9a0c32d698c1 ("drm/nouveau: don't fini scheduler if not initialized") Suggested-by: Danilo Krummrich Signed-off-by: Philipp Stanner --- Changes in v2: - Fix commit message (wrong named function). (Guys on IRC, M Henning) --- 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