[PATCH 06/10] rust: kernel: Update ARef and AlwaysRefCounted imports to use sync::aref

Shankari Anand posted 10 patches 1 week, 1 day ago
[PATCH 06/10] rust: kernel: Update ARef and AlwaysRefCounted imports to use sync::aref
Posted by Shankari Anand 1 week, 1 day ago
Update call sites in `pwm.rs` to import `ARef`
and `AlwaysRefCounted` from `sync::aref`
instead of `types`.

This aligns with the ongoing effort to move `ARef` and
`AlwaysRefCounted` to sync.

Suggested-by: Benno Lossin <lossin@kernel.org>
Link: https://github.com/Rust-for-Linux/linux/issues/1173
Signed-off-by: Shankari Anand <shankari.ak0208@gmail.com>
---
 rust/kernel/pwm.rs | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/rust/kernel/pwm.rs b/rust/kernel/pwm.rs
index cb00f8a8765c..1605d13d5d64 100644
--- a/rust/kernel/pwm.rs
+++ b/rust/kernel/pwm.rs
@@ -13,7 +13,8 @@
     devres,
     error::{self, to_result},
     prelude::*,
-    types::{ARef, AlwaysRefCounted, Opaque}, //
+    sync::aref::{ARef, AlwaysRefCounted},
+    types::Opaque, //
 };
 use core::{marker::PhantomData, ptr::NonNull};
 
-- 
2.34.1
Re: [PATCH 06/10] rust: kernel: Update ARef and AlwaysRefCounted imports to use sync::aref
Posted by Uwe Kleine-König 1 week ago
Hello,

I suggest $Subject ~= s/kernel/pwm/.

On Sun, Nov 23, 2025 at 02:54:34PM +0530, Shankari Anand wrote:
> Update call sites in `pwm.rs` to import `ARef`
> and `AlwaysRefCounted` from `sync::aref`
> instead of `types`.
> 
> This aligns with the ongoing effort to move `ARef` and
> `AlwaysRefCounted` to sync.
> 
> Suggested-by: Benno Lossin <lossin@kernel.org>
> Link: https://github.com/Rust-for-Linux/linux/issues/1173
> Signed-off-by: Shankari Anand <shankari.ak0208@gmail.com>
> ---
>  rust/kernel/pwm.rs | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/rust/kernel/pwm.rs b/rust/kernel/pwm.rs
> index cb00f8a8765c..1605d13d5d64 100644
> --- a/rust/kernel/pwm.rs
> +++ b/rust/kernel/pwm.rs
> @@ -13,7 +13,8 @@
>      devres,
>      error::{self, to_result},
>      prelude::*,
> -    types::{ARef, AlwaysRefCounted, Opaque}, //
> +    sync::aref::{ARef, AlwaysRefCounted},
> +    types::Opaque, //
>  };
>  use core::{marker::PhantomData, ptr::NonNull};

having no clue about Rust:

Can this patch be applied independent of the others via the pwm tree? If
I understand correctly it's only patch #10 that depends on the previous
patches, right?

Is there already a merge plan for this series?

Best regards
Uwe
Re: [PATCH 06/10] rust: kernel: Update ARef and AlwaysRefCounted imports to use sync::aref
Posted by Miguel Ojeda 6 days, 12 hours ago
On Mon, Nov 24, 2025 at 5:10 PM Uwe Kleine-König
<u.kleine-koenig@baylibre.com> wrote:
>
> having no clue about Rust:
>
> Can this patch be applied independent of the others via the pwm tree? If
> I understand correctly it's only patch #10 that depends on the previous
> patches, right?
>
> Is there already a merge plan for this series?

Yeah, if subsystems pick the independent patches at their own pace,
then that is great, so please do!

Then, after 1 or 2 cycles, we can do the flag day change on the Rust
tree (with any last changes needed Ack'd, but ideally there will be
none remaining).

It is what did in similar cases for renaming (or moving across the
path hierarchy) things in Rust. For simple things that get Ack'd quick
enough by everyone, sometimes we may be able to take everything in the
Rust tree.

Thanks!

Cheers,
Miguel
Re: [PATCH 06/10] rust: kernel: Update ARef and AlwaysRefCounted imports to use sync::aref
Posted by Michal Wilczynski 5 days, 13 hours ago

On 11/25/25 13:31, Miguel Ojeda wrote:
> On Mon, Nov 24, 2025 at 5:10 PM Uwe Kleine-König
> <u.kleine-koenig@baylibre.com> wrote:
>>
>> having no clue about Rust:
>>
>> Can this patch be applied independent of the others via the pwm tree? If
>> I understand correctly it's only patch #10 that depends on the previous
>> patches, right?
>>
>> Is there already a merge plan for this series?
> 
> Yeah, if subsystems pick the independent patches at their own pace,
> then that is great, so please do!
> 
> Then, after 1 or 2 cycles, we can do the flag day change on the Rust
> tree (with any last changes needed Ack'd, but ideally there will be
> none remaining).
> 
> It is what did in similar cases for renaming (or moving across the
> path hierarchy) things in Rust. For simple things that get Ack'd quick
> enough by everyone, sometimes we may be able to take everything in the
> Rust tree.
> 
> Thanks!
> 
> Cheers,
> Miguel
> 

I think code wise it's fine, provided the subject is fixed like Uwe suggested.

Acked-by: Michal Wilczynski <m.wilczynski@samsung.com>
Re: [PATCH 06/10] rust: kernel: Update ARef and AlwaysRefCounted imports to use sync::aref
Posted by Uwe Kleine-König 4 days, 18 hours ago
Hello,

On Wed, Nov 26, 2025 at 12:34:23PM +0100, Michal Wilczynski wrote:
> On 11/25/25 13:31, Miguel Ojeda wrote:
> > On Mon, Nov 24, 2025 at 5:10 PM Uwe Kleine-König
> > <u.kleine-koenig@baylibre.com> wrote:
> >>
> >> having no clue about Rust:
> >>
> >> Can this patch be applied independent of the others via the pwm tree? If
> >> I understand correctly it's only patch #10 that depends on the previous
> >> patches, right?
> >>
> >> Is there already a merge plan for this series?
> > 
> > Yeah, if subsystems pick the independent patches at their own pace,
> > then that is great, so please do!
> > 
> > Then, after 1 or 2 cycles, we can do the flag day change on the Rust
> > tree (with any last changes needed Ack'd, but ideally there will be
> > none remaining).
> > 
> > It is what did in similar cases for renaming (or moving across the
> > path hierarchy) things in Rust. For simple things that get Ack'd quick
> > enough by everyone, sometimes we may be able to take everything in the
> > Rust tree.
> 
> I think code wise it's fine, provided the subject is fixed like Uwe suggested.
> 
> Acked-by: Michal Wilczynski <m.wilczynski@samsung.com>

OK, I applied it to

	https://git.kernel.org/pub/scm/linux/kernel/git/ukleinek/linux.git pwm/for-nexxt

. I will rebase this branch to v6.19-rc1 once that's released and then
send it to Linus for v6.20-rc1 (assuming he has so many fingers and toes
to not switch to 7.0 before :-).

If it turns out to go in via the rust tree, tell me, then I'll drop it.
In that case take my

Acked-by: Uwe Kleine-König <ukleinek@kernel.org>

Best regards and thanks for the patch and the reviews,
Uwe