[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <96891e54-8614-4f98-8a98-ad90f18c8e43@gmail.com>
Date: Fri, 30 May 2025 19:29:29 +0200
From: Christian Schrefl <chrisi.schrefl@...il.com>
To: Danilo Krummrich <dakr@...nel.org>, gregkh@...uxfoundation.org,
rafael@...nel.org, ojeda@...nel.org, alex.gaynor@...il.com,
boqun.feng@...il.com, gary@...yguo.net, bjorn3_gh@...tonmail.com,
benno.lossin@...ton.me, a.hindborg@...nel.org, aliceryhl@...gle.com,
tmgross@...ch.edu
Cc: rust-for-linux@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 0/7] misc device: support device drivers
On 30.05.25 6:37 PM, Christian Schrefl wrote:
> Hi Danilo
>
> On 30.05.25 4:24 PM, Danilo Krummrich wrote:
>> This patch series adds support for device drivers to the misc device
>> abstraction.
>>
>> For design details, please see:
>> * patch 5 "rust: miscdevice: properly support device drivers"
>> * patch 6 "rust: miscdevice: expose the parent device as &Device<Bound>"
>>
>> This patch series depends on the pin-init series from Benno [1] as well as on
>> the misc device series from Christian [2], with UnsafePinned replaced with
>> Opaque, as suggested by Alice, since UnsafePinned may still take a while to
>> land.
>
> If you want I can send out a new version using `Opaque`.
>
> We could also add a type alias like:
>
> type UnsafePinned<T> = Opaque<T>;
I forgot that Opaque doesn't drop, this would not be quite as simple,
but with a newtype with a `Drop` impl it should be possible.
>
> That would then be removed in the `UnsafePinned` patches.
> This should make the migration simpler.
>
> Cheers
> Christian
>
>>
>> A branch containing this series and its dependencies can be found in [3].
>>
>> Thanks to Benno for his great help with pin-init!
>>
>> [1] https://lore.kernel.org/rust-for-linux/20250529081027.297648-1-lossin@kernel.org/
>> [2] https://lore.kernel.org/lkml/20250517-b4-rust_miscdevice_registrationdata-v3-0-cdb33e228d37@gmail.com/
>> [3] https://git.kernel.org/pub/scm/linux/kernel/git/dakr/linux.git/log/?h=rust/misc
>>
>> Danilo Krummrich (7):
>> rust: types: support fallible PinInit types in Opaque::pin_init
>> rust: revocable: support fallible PinInit types
>> rust: devres: support fallible in-place init for data
>> rust: faux: impl AsRef<Device<Bound>> for Registration
>> rust: miscdevice: properly support device drivers
>> rust: miscdevice: expose the parent device as &Device<Bound>
>> rust: sample: misc: implement device driver sample
>>
>> rust/kernel/devres.rs | 27 ++-
>> rust/kernel/faux.rs | 4 +-
>> rust/kernel/miscdevice.rs | 341 ++++++++++++++++++++++---------
>> rust/kernel/revocable.rs | 7 +-
>> rust/kernel/types.rs | 8 +-
>> samples/rust/Kconfig | 8 +
>> samples/rust/rust_misc_device.rs | 73 +++++--
>> 7 files changed, 350 insertions(+), 118 deletions(-)
>>
>>
>> base-commit: d5e34ea41dda1500a4dc163d6e96395fe7adc681
>
Powered by blists - more mailing lists