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 4F77314A4C7; Wed, 7 May 2025 18:41:58 +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=1746643318; cv=none; b=tdBdJ30KR9NUgokh3SpguXpTxvQc4AuWWemrLWGDUOoWcxAMscvFZMALROXERxk3itBpnrOS9T9LYvORb5f8bYOYK9FWw5qAAnHDo8K6d2IUKDU1jeKHiqCLPoUSEaPC/RcGH+LHwEEYayv2ItBHbG5+kjoffQCZE4/mwYY8otc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746643318; c=relaxed/simple; bh=BFHDSPk6S6lZ3DbiS0VGrPPstTq0ASsCu/I+koFKDSk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=SVZzLvPdnxSOJOJ7Yau7CRAovcWdWC0YdzVOOEXxUgrl8+Yai9krOou9mtwmmXd0iKySt8hBo5D4EvE1ppWDY1k5bgIOwEcWqAoMM0Zof9g0sqA4a22fH6paAnt9OykMLY0yYdtzSFXrqj+JVc5D0zCSMZ7aegXI8nZqDwmgR/k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=AGWPwcCd; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="AGWPwcCd" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C0DF4C4CEE2; Wed, 7 May 2025 18:41:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1746643318; bh=BFHDSPk6S6lZ3DbiS0VGrPPstTq0ASsCu/I+koFKDSk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AGWPwcCdhFs5ASJnnBcYdIwo/KFhxpKVNAVBoofrUD/eZl+xIa8hKiFoe2WWma0h6 5uc0goC2If8zA5+jkRW8Z2ZP2u4VcP7lxZyzkR1FApHfk0obg+j6Y8gruQ/E1gFWjQ AjcG68AP3Rbp5lIvy51Gww40bjbcwL5jK1eFvdPA= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, =?UTF-8?q?Christian=20K=C3=B6nig?= , Philipp Stanner , Danilo Krummrich Subject: [PATCH 5.15 02/55] drm/nouveau: Fix WARN_ON in nouveau_fence_context_kill() Date: Wed, 7 May 2025 20:39:03 +0200 Message-ID: <20250507183759.150982890@linuxfoundation.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250507183759.048732653@linuxfoundation.org> References: <20250507183759.048732653@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Philipp Stanner commit bbe5679f30d7690a9b6838a583b9690ea73fe0e9 upstream. Nouveau is mostly designed in a way that it's expected that fences only ever get signaled through nouveau_fence_signal(). However, in at least one other place, nouveau_fence_done(), can signal fences, too. If that happens (race) a signaled fence remains in the pending list for a while, until it gets removed by nouveau_fence_update(). Should nouveau_fence_context_kill() run in the meantime, this would be a bug because the function would attempt to set an error code on an already signaled fence. Have nouveau_fence_context_kill() check for a fence being signaled. Cc: stable@vger.kernel.org # v5.10+ Fixes: ea13e5abf807 ("drm/nouveau: signal pending fences when channel has been killed") Suggested-by: Christian König Signed-off-by: Philipp Stanner Link: https://lore.kernel.org/r/20250415121900.55719-3-phasta@kernel.org Signed-off-by: Danilo Krummrich Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/nouveau/nouveau_fence.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/gpu/drm/nouveau/nouveau_fence.c +++ b/drivers/gpu/drm/nouveau/nouveau_fence.c @@ -95,7 +95,7 @@ nouveau_fence_context_kill(struct nouvea while (!list_empty(&fctx->pending)) { fence = list_entry(fctx->pending.next, typeof(*fence), head); - if (error) + if (error && !dma_fence_is_signaled_locked(&fence->base)) dma_fence_set_error(&fence->base, error); if (nouveau_fence_signal(fence))