[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <298b7438-f6bc-4022-a56b-26585a6ddf91@oss.qualcomm.com>
Date: Fri, 19 Dec 2025 13:57:32 +0100
From: Konrad Dybcio <konrad.dybcio@....qualcomm.com>
To: Benno Lossin <lossin@...nel.org>,
Daniel Almeida <daniel.almeida@...labora.com>,
Konrad Dybcio <konradybcio@...nel.org>
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>,
Andreas Hindborg <a.hindborg@...nel.org>,
Alice Ryhl <aliceryhl@...gle.com>, Trevor Gross <tmgross@...ch.edu>,
Danilo Krummrich <dakr@...nel.org>, Georgi Djakov <djakov@...nel.org>,
Dmitry Baryshkov <dmitry.baryshkov@....qualcomm.com>,
Bjorn Andersson <bjorn.andersson@....qualcomm.com>,
Marijn Suijten <marijn.suijten@...ainline.org>,
linux-kernel@...r.kernel.org, rust-for-linux@...r.kernel.org,
linux-pm@...r.kernel.org
Subject: Re: [PATCH DNM 2/2] interconnect: Add a test Rust consumer driver
On 7/23/25 3:22 PM, Benno Lossin wrote:
> On Wed Jul 23, 2025 at 3:10 PM CEST, Daniel Almeida wrote:
>> On 22 Jul 2025, at 18:14, Konrad Dybcio <konradybcio@...nel.org> wrote:
>>> +#[pin_data]
>>> +struct IccTestConsumerDriver {
>>> + #[pin]
>>> + path: IccPath,
>>> +}
>>
>> I don’t think this does anything useful without PhantomPinned, but Benno is
>> the right person to chime in here.
>
> It does do something useful, there just has to be one type marked with
> `#[pin]` that is `!Unpin` (so for example `PhantomPinned`, `Opaque<T>`
> etc.).
>
> In this case however, `IccPath` is a newtype of `*mut bindings::icc_path`
> which isn't `PhantomPinned`, so this doesn't ensure that the
> `IccTestConsumerDriver` will stay pinned after initializing.
>
>> More importantly though, why do you have #[pin] on IccPath?
>
> Another question is: why is `IccPath` not a newtype of
> `Opaque<bindings::icc_path>`? And then one can use `&IccPath`.
The short answer to all of your questions happens to be the simple
"the code compiled".. :) I didn't know about Opaque<T>, thanks
Konrad
Powered by blists - more mailing lists