mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Eliot Courtney" <ecourtney@nvidia.com>
To: "Danilo Krummrich" <dakr@kernel.org>, <acourbot@nvidia.com>,
	<aliceryhl@google.com>, <airlied@gmail.com>, <simona@ffwll.ch>,
	<lossin@kernel.org>, <gary@garyguo.net>
Cc: <nova-gpu@lists.linux.dev>, <dri-devel@lists.freedesktop.org>,
	<rust-for-linux@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	"dri-devel" <dri-devel-bounces@lists.freedesktop.org>
Subject: Re: [PATCH] gpu: nova-core: use pin-init self-referential support
Date: Wed, 11 Nov 2026 14:00:28 +0900	[thread overview]
Message-ID: <DMS4810YPZUD.OWR39S5EZUNW@nvidia.com> (raw)
In-Reply-To: <20261110152746.140351-1-dakr@kernel.org>

On Wed Nov 11, 2026 at 12:27 AM JST, Danilo Krummrich wrote:
> Express all self-referential borrows through pin-init's self-referential
> support [1], replacing unsafely derived references.
>
> Cc: Gary Guo <gary@garyguo.net>
> Link: https://lore.kernel.org/all/20261008-dev-selfref-v2-0-e280b3c8fba5@garyguo.net/ [1]
> Signed-off-by: Danilo Krummrich <dakr@kernel.org>
> ---
>  drivers/gpu/nova-core/api.rs     | 24 ++++++++++++---
>  drivers/gpu/nova-core/driver.rs  | 53 +++++++++++---------------------
>  drivers/gpu/nova-core/gpu.rs     | 32 ++++++++-----------
>  drivers/gpu/nova-core/irq/gsp.rs | 17 +++++-----
>  4 files changed, 59 insertions(+), 67 deletions(-)
>
> diff --git a/drivers/gpu/nova-core/api.rs b/drivers/gpu/nova-core/api.rs
> index eec69aace3b2..94808af3886d 100644
> --- a/drivers/gpu/nova-core/api.rs
> +++ b/drivers/gpu/nova-core/api.rs
> @@ -22,11 +22,27 @@
>  };
>  
>  /// API handle for the auxiliary bus child drivers to interact with nova-core.
> -pub struct NovaCoreApi<'bound> {
> -    pub(crate) gpu: Pin<&'bound Gpu<'bound>>,
> +#[pin_data]
> +pub struct NovaCoreApi<'bound>
> +where
> +    // `Gpu` is invariant in its resource lifetime, which outlives this API borrow.
> +    exists<'gpu_resources>: 'bound,
> +{
> +    #[uses('gpu_resources: invariant)]
> +    gpu: Pin<&'bound Gpu<'gpu_resources>>,
>      pub(crate) pdev: &'bound pci::Device<Bound>,

nit: should we remove pub(crate) for `pdev` from here too?

Reviewed-by: Eliot Courtney <ecourtney@nvidia.com>


      reply	other threads:[~2026-11-11  5:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-10 15:27 Danilo Krummrich
2026-11-11  5:00 ` Eliot Courtney [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DMS4810YPZUD.OWR39S5EZUNW@nvidia.com \
    --to=ecourtney@nvidia.com \
    --cc=acourbot@nvidia.com \
    --cc=airlied@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=dakr@kernel.org \
    --cc=dri-devel-bounces@lists.freedesktop.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gary@garyguo.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lossin@kernel.org \
    --cc=nova-gpu@lists.linux.dev \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=simona@ffwll.ch \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®