From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 30CED606A321 for ; Thu, 12 Nov 2026 10:10:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=bT4qsb6R Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 953C110E59B; Thu, 12 Nov 2026 10:10:37 +0000 (UTC) Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by gabe.freedesktop.org (Postfix) with ESMTPS id 044A110E59B for ; Thu, 12 Nov 2026 10:10:31 +0000 (UTC) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id 00C39656FD; Thu, 12 Nov 2026 10:10:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3BF4C1F00A05; Thu, 12 Nov 2026 10:10:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1794478229; bh=q2h1KqWhx9zf6M/IsRZG4oHpBMjjaTsrgJqfO4pjmVU=; h=From:To:Cc:Subject:Date; b=bT4qsb6R3vWqNaYgvRTIzxP+EWXVWGsIdFYs3MY0T/+45P+WFccsLNOsR2qNd7o+N EylF7rFaycZPaDtoSfOcpsecSwIfMKV/SA3PvC3T7Lf55QI84bQYnqomGKnRkJJVVI bGl5Za89sQ+f2DN25PCtVEw1v7JKgmfCj5wD7Llj7Njl66vZ/RZuvBJLRtamaeyg8h aFsMaeE//j351W1bMTmTaSMXqWVBvOEjFjzAmHdsfxSPQTkbdwC2j41aHrpMsqcO6A darkJNapZIt2NwwMyOD1ZwZUaTt001l9atqLiGCUcfYNHdc+FzPmrTeh1gd+lN2QkN Blb0AquGbj/Vg== From: Philipp Stanner To: Sumit Semwal , =?UTF-8?q?Christian=20K=C3=B6nig?= , Philipp Stanner , Danilo Krummrich , Alice Ryhl , Miguel Ojeda , Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Andreas Hindborg , Trevor Gross , Daniel Almeida , Tamir Duberstein , Alexandre Courbot , =?UTF-8?q?Onur=20=C3=96zkan?= Cc: linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] rust: DamFence: Remove warning about unsignaled drop Date: Thu, 12 Nov 2026 11:10:16 +0100 Message-ID: <20261112101015.528127-2-phasta@kernel.org> X-Mailer: git-send-email 2.56.0 X-Archived-By: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "dri-devel" X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 DriverFence::drop() contains a pr_warn!() for when the fence drops unsignaled. This warning gets into the way of canonical teardown in Rust: when you drop a lock, it unlocks itself, when you drop a KBox, it frees itself etc. Congruently, users should be able to tear down fences they don't care about anymore with ECANCELED, which is already the default error code. Remove the warning. Suggested-by: Danilo Krummrich Signed-off-by: Philipp Stanner --- rust/kernel/dma_buf/dma_fence.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/rust/kernel/dma_buf/dma_fence.rs b/rust/kernel/dma_buf/dma_fence.rs index a1d851656562..2c8001cb9a59 100644 --- a/rust/kernel/dma_buf/dma_fence.rs +++ b/rust/kernel/dma_buf/dma_fence.rs @@ -942,7 +942,6 @@ fn drop(&mut self) { // SAFETY: `guard` is valid until the `call_rcu()` below. let signaled: bool = unsafe { bindings::dma_fence_test_signaled_flag(guard.as_raw()) }; if !signaled { - pr_err!("DriverFence drops unsignaled. Danger of memory corruption!\n"); // SAFETY: `guard` is valid until the `call_rcu()` below. The fence // must not have been signaled yet, which we check directly above. unsafe { bindings::dma_fence_set_error(guard.as_raw(), ECANCELED.to_errno()) }; -- 2.56.0