From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A27E8ECD6F1 for ; Wed, 11 Feb 2026 21:18:04 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 117BF10E659; Wed, 11 Feb 2026 21:18:03 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="pvFSgP7e"; dkim-atps=neutral Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1C54E10E656; Wed, 11 Feb 2026 21:18:01 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id 6C866419D9; Wed, 11 Feb 2026 21:18:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3614FC4CEF7; Wed, 11 Feb 2026 21:17:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1770844680; bh=Xk2na6235/6MdtkvIhpTRHZmnBktjn8EJsmkNHoHgrE=; h=Date:Subject:Cc:To:From:References:In-Reply-To:From; b=pvFSgP7elG8OioKaof0a5y8V+UeqIvIJPG+ORj4CYPFr0S2UTkWWWbG0TeASObmAG ld/2Ev08iZ7H17laDT6HY+vl5c1KPccISOEmTY5yNnb0KHbHe7X7dwBH35O5Kj5V80 I1nSWjqVMOy7jX1jsYA4lloLS+T/lz8JVK5hco0RhZ2RE3BYPtFbgpKTVxHX9+kKBm bOkKsO5SwTP3Vmc05Ti8merg7u0PtlDwVpPXxdTxMW62HnkGuhSqcsU9je/EYTJFW/ Jahai5V1xcB29kEuBDG9/KadzI/EDX63FjALRne+JKjabdUH/sLG44pAVNU/YFu6cV VPb0rG16+zFrQ== Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Wed, 11 Feb 2026 22:17:50 +0100 Message-Id: Subject: Re: [PATCH -next v8 1/3] rust: clist: Add support to interface with C linked lists Cc: , "Maarten Lankhorst" , "Maxime Ripard" , "Simona Vetter" , "Jonathan Corbet" , "Alex Deucher" , =?utf-8?q?Christian_K=C3=B6nig?= , "Jani Nikula" , "Joonas Lahtinen" , "Rodrigo Vivi" , "Tvrtko Ursulin" , "Huang Rui" , "Matthew Auld" , "Matthew Brost" , "Lucas De Marchi" , =?utf-8?q?Thomas_Hellstr=C3=B6m?= , "Helge Deller" , "Alice Ryhl" , "Miguel Ojeda" , "Alex Gaynor" , "Boqun Feng" , "Gary Guo" , =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= , "Benno Lossin" , "Andreas Hindborg" , "Trevor Gross" , "Alistair Popple" , "Alexandre Courbot" , "Andrea Righi" , "Zhi Wang" , "Philipp Stanner" , "Elle Rhumsaa" , "Daniel Almeida" , , , , , , , , , To: "Joel Fernandes" From: "Danilo Krummrich" References: <20260209214246.2783990-1-joelagnelf@nvidia.com> <20260209214246.2783990-2-joelagnelf@nvidia.com> <20260211210952.GA3632639@joelbox2> In-Reply-To: <20260211210952.GA3632639@joelbox2> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Wed Feb 11, 2026 at 10:09 PM CET, Joel Fernandes wrote: > On Tue, Feb 10, 2026 at 11:07:37AM +0100, Danilo Krummrich wrote: >> On Mon Feb 9, 2026 at 10:42 PM CET, Joel Fernandes wrote: >> > rust/kernel/clist.rs | 320 ++++++++++++++++++++++++++++++++++++++++= + >>=20 >> I think we should move this under rust/kernel/ffi/ to make it obvious th= at this >> is FFI infrastructure. >>=20 >> > diff --git a/rust/kernel/clist.rs b/rust/kernel/clist.rs >> > new file mode 100644 >> > index 000000000000..8aa72b5d54be >> > --- /dev/null >> > +++ b/rust/kernel/clist.rs >> > @@ -0,0 +1,320 @@ >> > +// SPDX-License-Identifier: GPL-2.0 >> > + >> > +//! A C doubly circular intrusive linked list interface for rust code= . >>=20 >> Here and in the struct documentation, I'd suggest to clearly point out t= he >> use-cases, i.e. that this infrastructure is for FFI use-cases only and s= hould >> not be used otherwise in drivers, etc > > I am curious why we would not want to have drivers be able to use CList. = I > thought that was the point of making it pub at the module/item level as w= ell. > I think it is possible a rust driver may have a reference to a CList in t= he > future. It is a (partially) unsafe API built to support FFI interactions. The absol= ute majority of drivers should not have any FFI interactions themselves. nova-c= ore is the "odd one" as it will have an interface with a C driver (vGPU). Besides a few "odd" drivers, there may be quite some subsystem abstractions= that become users of the API. In the future build system, subsystems and drivers= will become individual crates. > But I will update the current usecase above, as you suggested, good point= .