[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aDoIeYM2b8kXG8-O@Mac.home>
Date: Fri, 30 May 2025 12:35:21 -0700
From: Boqun Feng <boqun.feng@...il.com>
To: Benno Lossin <lossin@...nel.org>
Cc: Christian Schrefl <chrisi.schrefl@...il.com>,
Danilo Krummrich <dakr@...nel.org>, gregkh@...uxfoundation.org,
rafael@...nel.org, ojeda@...nel.org, alex.gaynor@...il.com,
gary@...yguo.net, bjorn3_gh@...tonmail.com, benno.lossin@...ton.me,
a.hindborg@...nel.org, aliceryhl@...gle.com, tmgross@...ch.edu,
rust-for-linux@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 0/7] misc device: support device drivers
On Fri, May 30, 2025 at 09:24:28PM +0200, Benno Lossin wrote:
> On Fri May 30, 2025 at 7:29 PM CEST, Christian Schrefl wrote:
> > On 30.05.25 6:37 PM, Christian Schrefl wrote:
> >> 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.
Maybe I'm missing something, but don't we have our own version of
`UnsafePinned` [1] which can be replaced once Rust upstream has the
`UnsafePinned` stabilized. I don't see any discussion about abandoning
that effort.
Regards,
Boqun
> >>
> >> 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's one issue another is that `Opaque` also allows uninitialized
> memory and (if the upstream one isn't changed) also modifies the
> behavior of shared references. I don't think we should name it
> `UnsafePinned` if it doesn't guarantee the same thing as the upstream
> one.
>
> ---
> Cheers,
> Benno
Powered by blists - more mailing lists