[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <DBJGTCPDUU4J.16S98YARG0S7O@kernel.org>
Date: Wed, 23 Jul 2025 15:22:49 +0200
From: "Benno Lossin" <lossin@...nel.org>
To: "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>, "Konrad
Dybcio" <konrad.dybcio@....qualcomm.com>
Subject: Re: [PATCH DNM 2/2] interconnect: Add a test Rust consumer driver
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`.
---
Cheers,
Benno
Powered by blists - more mailing lists