[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aCtzK-BQS-sVRC20@google.com>
Date: Mon, 19 May 2025 18:06:35 +0000
From: Alice Ryhl <aliceryhl@...gle.com>
To: Christian Schrefl <chrisi.schrefl@...il.com>
Cc: Miguel Ojeda <ojeda@...nel.org>, Alex Gaynor <alex.gaynor@...il.com>,
Boqun Feng <boqun.feng@...il.com>, Gary Guo <gary@...yguo.net>,
"Björn Roy Baron" <bjorn3_gh@...tonmail.com>, Benno Lossin <benno.lossin@...ton.me>,
Andreas Hindborg <a.hindborg@...nel.org>, Trevor Gross <tmgross@...ch.edu>, Arnd Bergmann <arnd@...db.de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>, Lee Jones <lee@...nel.org>,
Daniel Almeida <daniel.almeida@...labora.com>, Danilo Krummrich <dakr@...nel.org>,
"Gerald Wisböck" <gerald.wisboeck@...ther.ink>, rust-for-linux@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 0/2] rust: miscdevice: add additional data to MiscDeviceRegistration
On Sat, May 17, 2025 at 01:33:48PM +0200, Christian Schrefl wrote:
> Currently there is no good way to pass arbitrary data from the driver to
> a `miscdevice` or to share data between individual handles to a
> `miscdevice` in rust.
>
> This series adds additional (generic) data to the MiscDeviceRegistration
> for this purpose.
>
> The first patch implements the changes and fixes the build of the sample
> without changing any functionality (this is currently the only in tree
> user).
>
> The second patch changes the `rust_misc_device` sample to use this to
> share the same data between multiple handles to the `miscdevice`.
> I have tested the sample with qemu and the C userspace example
> from the doc comments.
>
> This series its based on my `UnsafePinned` series [0] and the
> pin-init-next branch.
>
> Some discussion on Zulip about the motivation and approach [1].
> Thanks a lot to everyone helping me out with this.
>
> Link: https://lore.kernel.org/rust-for-linux/20250430-rust_unsafe_pinned-v2-0-fc8617a74024@gmail.com/ [0]
> Link: https://rust-for-linux.zulipchat.com/#narrow/channel/288089-General/topic/Passing.20a.20DevRes.20to.20a.20miscdev/near/494553814 [1]
>
> Signed-off-by: Christian Schrefl <chrisi.schrefl@...il.com>
Reviewed-by: Alice Ryhl <aliceryhl@...gle.com>
Danilo's comment on the design of miscdevice is fair - it does not match
other types of drivers. But this series is an improvement over what is
here today.
Alice
Powered by blists - more mailing lists