[PATCH 02/10] drivers: gpu: Update ARef imports from sync::aref

Shankari Anand posted 10 patches 1 week, 1 day ago
[PATCH 02/10] drivers: gpu: Update ARef imports from sync::aref
Posted by Shankari Anand 1 week, 1 day ago
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
Re: [PATCH 02/10] drivers: gpu: Update ARef imports from sync::aref
Posted by Joel Fernandes 1 week ago

On 11/23/2025 4:24 AM, Shankari Anand wrote:
> 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>

Reviewed-by: Joel Fernandes <joelagnelf@nvidia.com>

thanks,

 - Joel


> ---
>  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::{
Re: [PATCH 02/10] drivers: gpu: Update ARef imports from sync::aref
Posted by Alexandre Courbot 1 week ago
On Sun Nov 23, 2025 at 6:24 PM JST, Shankari Anand wrote:
> 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, //

I think you will want to move the trailing `//` to the new last line instead
of carrying it when moving `ARef`.

With this, for nova-core,

Acked-by: Alexandre Courbot <acourbot@nvidia.com>