* [PATCH 01/10] drivers: android: binder: Update ARef imports from sync::aref
2025-11-23 9:24 [PATCH 00/10] rust: refactor ARef and AlwaysRefCounted imports Shankari Anand
@ 2025-11-23 9:24 ` Shankari Anand
2025-11-23 9:24 ` [PATCH 02/10] drivers: gpu: " Shankari Anand
` (8 subsequent siblings)
9 siblings, 0 replies; 12+ messages in thread
From: Shankari Anand @ 2025-11-23 9:24 UTC (permalink / raw)
To: Greg Kroah-Hartman, Arve Hjønnevåg, Todd Kjos,
Martijn Coenen, Joel Fernandes, Christian Brauner, Carlos Llamas,
Suren Baghdasaryan, Danilo Krummrich, Alice Ryhl,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Alexandre Courbot, Rafael J . Wysocki,
Miguel Ojeda, Alex Gaynor, Igor Korotin, Michal Wilczynski
Cc: Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
Andreas Hindborg, Trevor Gross, Daniel Almeida, Abdiel Janulgue,
Robin Murphy, linux-kernel, dri-devel, nouveau, rust-for-linux,
linux-pwm, Shankari Anand
Update call sites in binder files to import `ARef`
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>
---
drivers/android/binder/process.rs | 2 +-
drivers/android/binder/thread.rs | 3 +--
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/android/binder/process.rs b/drivers/android/binder/process.rs
index e5237e9ec552..1409129ff82a 100644
--- a/drivers/android/binder/process.rs
+++ b/drivers/android/binder/process.rs
@@ -27,11 +27,11 @@
seq_print,
sync::poll::PollTable,
sync::{
+ aref::ARef,
lock::{spinlock::SpinLockBackend, Guard},
Arc, ArcBorrow, CondVar, CondVarTimeoutResult, Mutex, SpinLock, UniqueArc,
},
task::Task,
- types::ARef,
uaccess::{UserSlice, UserSliceReader},
uapi,
workqueue::{self, Work},
diff --git a/drivers/android/binder/thread.rs b/drivers/android/binder/thread.rs
index 7e34ccd394f8..033af3ce352e 100644
--- a/drivers/android/binder/thread.rs
+++ b/drivers/android/binder/thread.rs
@@ -16,9 +16,8 @@
seq_file::SeqFile,
seq_print,
sync::poll::{PollCondVar, PollTable},
- sync::{Arc, SpinLock},
+ sync::{aref::ARef, Arc, SpinLock},
task::Task,
- types::ARef,
uaccess::UserSlice,
uapi,
};
--
2.34.1
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH 02/10] drivers: gpu: Update ARef imports from sync::aref
2025-11-23 9:24 [PATCH 00/10] rust: refactor ARef and AlwaysRefCounted imports Shankari Anand
2025-11-23 9:24 ` [PATCH 01/10] drivers: android: binder: Update ARef imports from sync::aref Shankari Anand
@ 2025-11-23 9:24 ` Shankari Anand
2025-11-23 9:24 ` [PATCH 03/10] rust: device: Update ARef and AlwaysRefCounted " Shankari Anand
` (7 subsequent siblings)
9 siblings, 0 replies; 12+ messages in thread
From: Shankari Anand @ 2025-11-23 9:24 UTC (permalink / raw)
To: Greg Kroah-Hartman, Arve Hjønnevåg, Todd Kjos,
Martijn Coenen, Joel Fernandes, Christian Brauner, Carlos Llamas,
Suren Baghdasaryan, Danilo Krummrich, Alice Ryhl,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Alexandre Courbot, Rafael J . Wysocki,
Miguel Ojeda, Alex Gaynor, Igor Korotin, Michal Wilczynski
Cc: Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
Andreas Hindborg, Trevor Gross, Daniel Almeida, Abdiel Janulgue,
Robin Murphy, linux-kernel, dri-devel, nouveau, rust-for-linux,
linux-pwm, Shankari Anand
Update call sites to import `ARef` 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>
---
drivers/gpu/drm/tyr/driver.rs | 2 +-
drivers/gpu/nova-core/gsp/sequencer.rs | 2 +-
drivers/gpu/nova-core/vbios.rs | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/tyr/driver.rs b/drivers/gpu/drm/tyr/driver.rs
index 0389c558c036..264c2362237a 100644
--- a/drivers/gpu/drm/tyr/driver.rs
+++ b/drivers/gpu/drm/tyr/driver.rs
@@ -16,10 +16,10 @@
use kernel::regulator;
use kernel::regulator::Regulator;
use kernel::sizes::SZ_2M;
+use kernel::sync::aref::ARef;
use kernel::sync::Arc;
use kernel::sync::Mutex;
use kernel::time;
-use kernel::types::ARef;
use crate::file::File;
use crate::gem::TyrObject;
diff --git a/drivers/gpu/nova-core/gsp/sequencer.rs b/drivers/gpu/nova-core/gsp/sequencer.rs
index 2d0369c49092..9c689f0b21ab 100644
--- a/drivers/gpu/nova-core/gsp/sequencer.rs
+++ b/drivers/gpu/nova-core/gsp/sequencer.rs
@@ -14,12 +14,12 @@
device,
io::poll::read_poll_timeout,
prelude::*,
+ sync::aref::ARef, //
time::{
delay::fsleep,
Delta, //
},
transmute::FromBytes,
- types::ARef, //
};
use crate::{
diff --git a/drivers/gpu/nova-core/vbios.rs b/drivers/gpu/nova-core/vbios.rs
index abf423560ff4..7c26e4a2d61c 100644
--- a/drivers/gpu/nova-core/vbios.rs
+++ b/drivers/gpu/nova-core/vbios.rs
@@ -11,8 +11,8 @@
Alignable,
Alignment, //
},
+ sync::aref::ARef,
transmute::FromBytes,
- types::ARef,
};
use crate::{
--
2.34.1
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH 03/10] rust: device: Update ARef and AlwaysRefCounted imports from sync::aref
2025-11-23 9:24 [PATCH 00/10] rust: refactor ARef and AlwaysRefCounted imports Shankari Anand
2025-11-23 9:24 ` [PATCH 01/10] drivers: android: binder: Update ARef imports from sync::aref Shankari Anand
2025-11-23 9:24 ` [PATCH 02/10] drivers: gpu: " Shankari Anand
@ 2025-11-23 9:24 ` Shankari Anand
2025-11-23 9:24 ` [PATCH 04/10] rust: drm: Update AlwaysRefCounted imports to use sync::aref Shankari Anand
` (6 subsequent siblings)
9 siblings, 0 replies; 12+ messages in thread
From: Shankari Anand @ 2025-11-23 9:24 UTC (permalink / raw)
To: Greg Kroah-Hartman, Arve Hjønnevåg, Todd Kjos,
Martijn Coenen, Joel Fernandes, Christian Brauner, Carlos Llamas,
Suren Baghdasaryan, Danilo Krummrich, Alice Ryhl,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Alexandre Courbot, Rafael J . Wysocki,
Miguel Ojeda, Alex Gaynor, Igor Korotin, Michal Wilczynski
Cc: Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
Andreas Hindborg, Trevor Gross, Daniel Almeida, Abdiel Janulgue,
Robin Murphy, linux-kernel, dri-devel, nouveau, rust-for-linux,
linux-pwm, Shankari Anand
Update call sites 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/device.rs | 4 ++--
rust/kernel/device/property.rs | 5 +++--
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/rust/kernel/device.rs b/rust/kernel/device.rs
index c79be2e2bfe3..21bde8d95185 100644
--- a/rust/kernel/device.rs
+++ b/rust/kernel/device.rs
@@ -158,7 +158,7 @@
/// `bindings::device::release` is valid to be called from any thread, hence `ARef<Device>` can be
/// dropped from any thread.
///
-/// [`AlwaysRefCounted`]: kernel::types::AlwaysRefCounted
+/// [`AlwaysRefCounted`]: kernel::sync::aref::AlwaysRefCounted
/// [`impl_device_context_deref`]: kernel::impl_device_context_deref
/// [`pci::Device`]: kernel::pci::Device
/// [`platform::Device`]: kernel::platform::Device
@@ -540,7 +540,7 @@ pub trait DeviceContext: private::Sealed {}
/// [`Device<Normal>`]. It is the only [`DeviceContext`] for which it is valid to implement
/// [`AlwaysRefCounted`] for.
///
-/// [`AlwaysRefCounted`]: kernel::types::AlwaysRefCounted
+/// [`AlwaysRefCounted`]: kernel::sync::aref::AlwaysRefCounted
pub struct Normal;
/// The [`Core`] context is the context of a bus specific device when it appears as argument of
diff --git a/rust/kernel/device/property.rs b/rust/kernel/device/property.rs
index 3a332a8c53a9..413221817ef1 100644
--- a/rust/kernel/device/property.rs
+++ b/rust/kernel/device/property.rs
@@ -14,7 +14,8 @@
fmt,
prelude::*,
str::{CStr, CString},
- types::{ARef, Opaque},
+ sync::aref::ARef,
+ types::Opaque,
};
/// A reference-counted fwnode_handle.
@@ -359,7 +360,7 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
}
// SAFETY: Instances of `FwNode` are always reference-counted.
-unsafe impl crate::types::AlwaysRefCounted for FwNode {
+unsafe impl crate::sync::aref::AlwaysRefCounted for FwNode {
fn inc_ref(&self) {
// SAFETY: The existence of a shared reference guarantees that the
// refcount is non-zero.
--
2.34.1
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH 04/10] rust: drm: Update AlwaysRefCounted imports to use sync::aref
2025-11-23 9:24 [PATCH 00/10] rust: refactor ARef and AlwaysRefCounted imports Shankari Anand
` (2 preceding siblings ...)
2025-11-23 9:24 ` [PATCH 03/10] rust: device: Update ARef and AlwaysRefCounted " Shankari Anand
@ 2025-11-23 9:24 ` Shankari Anand
2025-11-23 9:24 ` [PATCH 05/10] rust: kernel: Update ARef and " Shankari Anand
` (5 subsequent siblings)
9 siblings, 0 replies; 12+ messages in thread
From: Shankari Anand @ 2025-11-23 9:24 UTC (permalink / raw)
To: Greg Kroah-Hartman, Arve Hjønnevåg, Todd Kjos,
Martijn Coenen, Joel Fernandes, Christian Brauner, Carlos Llamas,
Suren Baghdasaryan, Danilo Krummrich, Alice Ryhl,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Alexandre Courbot, Rafael J . Wysocki,
Miguel Ojeda, Alex Gaynor, Igor Korotin, Michal Wilczynski
Cc: Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
Andreas Hindborg, Trevor Gross, Daniel Almeida, Abdiel Janulgue,
Robin Murphy, linux-kernel, dri-devel, nouveau, rust-for-linux,
linux-pwm, Shankari Anand
Update call sites to import `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/drm/gem/mod.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/rust/kernel/drm/gem/mod.rs b/rust/kernel/drm/gem/mod.rs
index a7f682e95c01..76e6c40d525e 100644
--- a/rust/kernel/drm/gem/mod.rs
+++ b/rust/kernel/drm/gem/mod.rs
@@ -253,7 +253,7 @@ extern "C" fn free_callback(obj: *mut bindings::drm_gem_object) {
}
// SAFETY: Instances of `Object<T>` are always reference-counted.
-unsafe impl<T: DriverObject> crate::types::AlwaysRefCounted for Object<T> {
+unsafe impl<T: DriverObject> crate::sync::aref::AlwaysRefCounted for Object<T> {
fn inc_ref(&self) {
// SAFETY: The existence of a shared reference guarantees that the refcount is non-zero.
unsafe { bindings::drm_gem_object_get(self.as_raw()) };
--
2.34.1
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH 05/10] rust: kernel: Update ARef and AlwaysRefCounted imports to use sync::aref
2025-11-23 9:24 [PATCH 00/10] rust: refactor ARef and AlwaysRefCounted imports Shankari Anand
` (3 preceding siblings ...)
2025-11-23 9:24 ` [PATCH 04/10] rust: drm: Update AlwaysRefCounted imports to use sync::aref Shankari Anand
@ 2025-11-23 9:24 ` Shankari Anand
2025-11-23 13:16 ` Igor Korotin
2025-11-23 9:24 ` [PATCH 06/10] " Shankari Anand
` (4 subsequent siblings)
9 siblings, 1 reply; 12+ messages in thread
From: Shankari Anand @ 2025-11-23 9:24 UTC (permalink / raw)
To: Greg Kroah-Hartman, Arve Hjønnevåg, Todd Kjos,
Martijn Coenen, Joel Fernandes, Christian Brauner, Carlos Llamas,
Suren Baghdasaryan, Danilo Krummrich, Alice Ryhl,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Alexandre Courbot, Rafael J . Wysocki,
Miguel Ojeda, Alex Gaynor, Igor Korotin, Michal Wilczynski
Cc: Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
Andreas Hindborg, Trevor Gross, Daniel Almeida, Abdiel Janulgue,
Robin Murphy, linux-kernel, dri-devel, nouveau, rust-for-linux,
linux-pwm, Shankari Anand
Update call sites in `i2c.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/i2c.rs | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/rust/kernel/i2c.rs b/rust/kernel/i2c.rs
index 1aee46f59460..c50ca464d87c 100644
--- a/rust/kernel/i2c.rs
+++ b/rust/kernel/i2c.rs
@@ -17,10 +17,8 @@
of,
prelude::*,
str::CStrExt as _,
- types::{
- AlwaysRefCounted,
- Opaque, //
- }, //
+ sync::aref::AlwaysRefCounted,
+ types::Opaque, //
};
use core::{
@@ -32,7 +30,7 @@
}, //
};
-use kernel::types::ARef;
+use kernel::sync::aref::ARef;
/// An I2C device id table.
#[repr(transparent)]
@@ -408,7 +406,7 @@ pub fn get(index: i32) -> Result<ARef<Self>> {
kernel::impl_device_context_into_aref!(I2cAdapter);
// SAFETY: Instances of `I2cAdapter` are always reference-counted.
-unsafe impl crate::types::AlwaysRefCounted for I2cAdapter {
+unsafe impl crate::sync::aref::AlwaysRefCounted for I2cAdapter {
fn inc_ref(&self) {
// SAFETY: The existence of a shared reference guarantees that the refcount is non-zero.
unsafe { bindings::i2c_get_adapter(self.index()) };
--
2.34.1
^ permalink raw reply related [flat|nested] 12+ messages in thread* Re: [PATCH 05/10] rust: kernel: Update ARef and AlwaysRefCounted imports to use sync::aref
2025-11-23 9:24 ` [PATCH 05/10] rust: kernel: Update ARef and " Shankari Anand
@ 2025-11-23 13:16 ` Igor Korotin
0 siblings, 0 replies; 12+ messages in thread
From: Igor Korotin @ 2025-11-23 13:16 UTC (permalink / raw)
To: Shankari Anand, Greg Kroah-Hartman, Arve Hjønnevåg,
Todd Kjos, Martijn Coenen, Joel Fernandes, Christian Brauner,
Carlos Llamas, Suren Baghdasaryan, Danilo Krummrich, Alice Ryhl,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Alexandre Courbot, Rafael J . Wysocki,
Miguel Ojeda, Alex Gaynor, Michal Wilczynski
Cc: Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
Andreas Hindborg, Trevor Gross, Daniel Almeida, Abdiel Janulgue,
Robin Murphy, linux-kernel, dri-devel, nouveau, rust-for-linux,
linux-pwm
Hello Shankari
On 11/23/2025 9:24 AM, Shankari Anand wrote:
> Update call sites in `i2c.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/i2c.rs | 10 ++++------
> 1 file changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/rust/kernel/i2c.rs b/rust/kernel/i2c.rs
> index 1aee46f59460..c50ca464d87c 100644
> --- a/rust/kernel/i2c.rs
> +++ b/rust/kernel/i2c.rs
> @@ -17,10 +17,8 @@
> of,
> prelude::*,
> str::CStrExt as _,
> - types::{
> - AlwaysRefCounted,
> - Opaque, //
> - }, //
> + sync::aref::AlwaysRefCounted,
> + types::Opaque, //
> };
>
> use core::{
> @@ -32,7 +30,7 @@
> }, //
> };
>
> -use kernel::types::ARef;
> +use kernel::sync::aref::ARef;
>
> /// An I2C device id table.
> #[repr(transparent)]
> @@ -408,7 +406,7 @@ pub fn get(index: i32) -> Result<ARef<Self>> {
> kernel::impl_device_context_into_aref!(I2cAdapter);
>
> // SAFETY: Instances of `I2cAdapter` are always reference-counted.
> -unsafe impl crate::types::AlwaysRefCounted for I2cAdapter {
> +unsafe impl crate::sync::aref::AlwaysRefCounted for I2cAdapter {
NIT: This module already imports `AlwaysRefCounted`, so please use the
imported name instead of the full path for consistency.
> fn inc_ref(&self) {
> // SAFETY: The existence of a shared reference guarantees that the refcount is non-zero.
> unsafe { bindings::i2c_get_adapter(self.index()) };
Thanks
Igor
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 06/10] rust: kernel: Update ARef and AlwaysRefCounted imports to use sync::aref
2025-11-23 9:24 [PATCH 00/10] rust: refactor ARef and AlwaysRefCounted imports Shankari Anand
` (4 preceding siblings ...)
2025-11-23 9:24 ` [PATCH 05/10] rust: kernel: Update ARef and " Shankari Anand
@ 2025-11-23 9:24 ` Shankari Anand
2025-11-23 9:24 ` [PATCH 07/10] rust: kernel: Update ARef " Shankari Anand
` (3 subsequent siblings)
9 siblings, 0 replies; 12+ messages in thread
From: Shankari Anand @ 2025-11-23 9:24 UTC (permalink / raw)
To: Greg Kroah-Hartman, Arve Hjønnevåg, Todd Kjos,
Martijn Coenen, Joel Fernandes, Christian Brauner, Carlos Llamas,
Suren Baghdasaryan, Danilo Krummrich, Alice Ryhl,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Alexandre Courbot, Rafael J . Wysocki,
Miguel Ojeda, Alex Gaynor, Igor Korotin, Michal Wilczynski
Cc: Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
Andreas Hindborg, Trevor Gross, Daniel Almeida, Abdiel Janulgue,
Robin Murphy, linux-kernel, dri-devel, nouveau, rust-for-linux,
linux-pwm, Shankari Anand
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
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH 07/10] rust: kernel: Update ARef imports to use sync::aref
2025-11-23 9:24 [PATCH 00/10] rust: refactor ARef and AlwaysRefCounted imports Shankari Anand
` (5 preceding siblings ...)
2025-11-23 9:24 ` [PATCH 06/10] " Shankari Anand
@ 2025-11-23 9:24 ` Shankari Anand
2025-11-23 9:24 ` [PATCH 08/10] rust: kernel: Update AlwaysRefCounted " Shankari Anand
` (2 subsequent siblings)
9 siblings, 0 replies; 12+ messages in thread
From: Shankari Anand @ 2025-11-23 9:24 UTC (permalink / raw)
To: Greg Kroah-Hartman, Arve Hjønnevåg, Todd Kjos,
Martijn Coenen, Joel Fernandes, Christian Brauner, Carlos Llamas,
Suren Baghdasaryan, Danilo Krummrich, Alice Ryhl,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Alexandre Courbot, Rafael J . Wysocki,
Miguel Ojeda, Alex Gaynor, Igor Korotin, Michal Wilczynski
Cc: Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
Andreas Hindborg, Trevor Gross, Daniel Almeida, Abdiel Janulgue,
Robin Murphy, linux-kernel, dri-devel, nouveau, rust-for-linux,
linux-pwm, Shankari Anand
Update call sites in `scatterlist.rs` to import `ARef`
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/scatterlist.rs | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/rust/kernel/scatterlist.rs b/rust/kernel/scatterlist.rs
index 196fdb9a75e7..b83c468b5c63 100644
--- a/rust/kernel/scatterlist.rs
+++ b/rust/kernel/scatterlist.rs
@@ -38,7 +38,8 @@
io::ResourceSize,
page,
prelude::*,
- types::{ARef, Opaque},
+ sync::aref::ARef,
+ types::Opaque,
};
use core::{ops::Deref, ptr::NonNull};
--
2.34.1
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH 08/10] rust: kernel: Update AlwaysRefCounted imports to use sync::aref
2025-11-23 9:24 [PATCH 00/10] rust: refactor ARef and AlwaysRefCounted imports Shankari Anand
` (6 preceding siblings ...)
2025-11-23 9:24 ` [PATCH 07/10] rust: kernel: Update ARef " Shankari Anand
@ 2025-11-23 9:24 ` Shankari Anand
2025-11-23 9:24 ` [PATCH 09/10] samples: rust: Update ARef " Shankari Anand
2025-11-23 9:24 ` [PATCH 10/10] rust: kernel: remove temporary re-exports of ARef and AlwaysRefCounted Shankari Anand
9 siblings, 0 replies; 12+ messages in thread
From: Shankari Anand @ 2025-11-23 9:24 UTC (permalink / raw)
To: Greg Kroah-Hartman, Arve Hjønnevåg, Todd Kjos,
Martijn Coenen, Joel Fernandes, Christian Brauner, Carlos Llamas,
Suren Baghdasaryan, Danilo Krummrich, Alice Ryhl,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Alexandre Courbot, Rafael J . Wysocki,
Miguel Ojeda, Alex Gaynor, Igor Korotin, Michal Wilczynski
Cc: Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
Andreas Hindborg, Trevor Gross, Daniel Almeida, Abdiel Janulgue,
Robin Murphy, linux-kernel, dri-devel, nouveau, rust-for-linux,
linux-pwm, Shankari Anand
Update call sites in `usb.rs` to import `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/usb.rs | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/rust/kernel/usb.rs b/rust/kernel/usb.rs
index d10b65e9fb6a..79ff2f881572 100644
--- a/rust/kernel/usb.rs
+++ b/rust/kernel/usb.rs
@@ -12,7 +12,8 @@
error::{from_result, to_result, Result},
prelude::*,
str::CStr,
- types::{AlwaysRefCounted, Opaque},
+ sync::aref::AlwaysRefCounted,
+ types::Opaque,
ThisModule,
};
use core::{
--
2.34.1
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH 09/10] samples: rust: Update ARef imports to use sync::aref
2025-11-23 9:24 [PATCH 00/10] rust: refactor ARef and AlwaysRefCounted imports Shankari Anand
` (7 preceding siblings ...)
2025-11-23 9:24 ` [PATCH 08/10] rust: kernel: Update AlwaysRefCounted " Shankari Anand
@ 2025-11-23 9:24 ` Shankari Anand
2025-11-23 9:24 ` [PATCH 10/10] rust: kernel: remove temporary re-exports of ARef and AlwaysRefCounted Shankari Anand
9 siblings, 0 replies; 12+ messages in thread
From: Shankari Anand @ 2025-11-23 9:24 UTC (permalink / raw)
To: Greg Kroah-Hartman, Arve Hjønnevåg, Todd Kjos,
Martijn Coenen, Joel Fernandes, Christian Brauner, Carlos Llamas,
Suren Baghdasaryan, Danilo Krummrich, Alice Ryhl,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Alexandre Courbot, Rafael J . Wysocki,
Miguel Ojeda, Alex Gaynor, Igor Korotin, Michal Wilczynski
Cc: Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
Andreas Hindborg, Trevor Gross, Daniel Almeida, Abdiel Janulgue,
Robin Murphy, linux-kernel, dri-devel, nouveau, rust-for-linux,
linux-pwm, Shankari Anand
Update call sites in `rust_debugfs.rs` to import `ARef`
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>
---
samples/rust/rust_debugfs.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/samples/rust/rust_debugfs.rs b/samples/rust/rust_debugfs.rs
index 025e8f9d12de..be245da577a1 100644
--- a/samples/rust/rust_debugfs.rs
+++ b/samples/rust/rust_debugfs.rs
@@ -39,7 +39,7 @@
use kernel::sizes::*;
use kernel::sync::atomic::{Atomic, Relaxed};
use kernel::sync::Mutex;
-use kernel::{acpi, device::Core, of, platform, str::CString, types::ARef};
+use kernel::{acpi, device::Core, of, platform, str::CString, sync::aref::ARef};
kernel::module_platform_driver! {
type: RustDebugFs,
--
2.34.1
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH 10/10] rust: kernel: remove temporary re-exports of ARef and AlwaysRefCounted
2025-11-23 9:24 [PATCH 00/10] rust: refactor ARef and AlwaysRefCounted imports Shankari Anand
` (8 preceding siblings ...)
2025-11-23 9:24 ` [PATCH 09/10] samples: rust: Update ARef " Shankari Anand
@ 2025-11-23 9:24 ` Shankari Anand
9 siblings, 0 replies; 12+ messages in thread
From: Shankari Anand @ 2025-11-23 9:24 UTC (permalink / raw)
To: Greg Kroah-Hartman, Arve Hjønnevåg, Todd Kjos,
Martijn Coenen, Joel Fernandes, Christian Brauner, Carlos Llamas,
Suren Baghdasaryan, Danilo Krummrich, Alice Ryhl,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Alexandre Courbot, Rafael J . Wysocki,
Miguel Ojeda, Alex Gaynor, Igor Korotin, Michal Wilczynski
Cc: Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
Andreas Hindborg, Trevor Gross, Daniel Almeida, Abdiel Janulgue,
Robin Murphy, linux-kernel, dri-devel, nouveau, rust-for-linux,
linux-pwm, Shankari Anand
Remove the temporary re-exports of `ARef` and `AlwaysRefCounted`
from `types.rs` now that all in-tree users have been updated to
import them directly from `sync::aref`.
These re-exports were originally added to avoid breaking the
kernel build during the transition period while call sites were
incrementally migrated. With all users updated, they are no
longer needed.
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/types.rs | 2 --
1 file changed, 2 deletions(-)
diff --git a/rust/kernel/types.rs b/rust/kernel/types.rs
index 9c5e7dbf1632..4329d3c2c2e5 100644
--- a/rust/kernel/types.rs
+++ b/rust/kernel/types.rs
@@ -11,8 +11,6 @@
};
use pin_init::{PinInit, Wrapper, Zeroable};
-pub use crate::sync::aref::{ARef, AlwaysRefCounted};
-
/// Used to transfer ownership to and from foreign (non-Rust) languages.
///
/// Ownership is transferred from Rust to a foreign language by calling [`Self::into_foreign`] and
--
2.34.1
^ permalink raw reply related [flat|nested] 12+ messages in thread