dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Danilo Krummrich" <dakr@kernel.org>
To: "Gary Guo" <gary@garyguo.net>
Cc: <acourbot@nvidia.com>, <aliceryhl@google.com>,
	<nova-gpu@lists.linux.dev>, <dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH] gpu: nova-core: use a single try_pin_init!() block in probe()
Date: Mon, 28 Sep 2026 14:15:13 +0200	[thread overview]
Message-ID: <DLQXWXRP3P1J.28SLFOJJQ2EDK@kernel.org> (raw)
In-Reply-To: <DLQXTBWUJWGP.WGY6G88ATQM7@garyguo.net>

On Mon Sep 28, 2026 at 2:10 PM CEST, Gary Guo wrote:
> On Mon Sep 28, 2026 at 1:00 PM BST, Danilo Krummrich wrote:
>> On Mon Sep 28, 2026 at 1:36 PM CEST, Gary Guo wrote:
>>> I think this doesn't need to use `pin_chain`? You can do
>>>
>>>     gpu <- ...,
>>>
>>>     _: {
>>>         #[cfg(...)]
>>>         gpu.run_self_tests(pdev);
>>>     }
>>
>> Unfortunately, this produces the following error.
>>
>> 	error[E0382]: borrow of moved value: `gpu`
>> 	   --> drivers/gpu/nova-core/driver.rs:140:62
>> 	    |
>> 	119 |             gpu <- Gpu::new(
>> 	    |             --- move occurs because `gpu` has type `core::pin::Pin<&mut gpu::Gpu<'_>>`, which does not implement the `Copy` trait
>> 	...
>> 	129 |                 gpu.run_selftests(pdev);
>> 	    |                 --- value moved here
>
>     gpu.as_mut().run_selftests(pdev);
>
> should work?

I tried that previously, that gives another error. I didn't dig in further
though.

	error[E0596]: cannot borrow `gpu` as mutable, as it is not declared as mutable
	   --> drivers/gpu/nova-core/driver.rs:129:17
	    |
	129 |                 gpu.as_mut().run_selftests(pdev);
	    |                 ^^^ cannot borrow as mutable
	    |
	help: consider changing this to be mutable
	    |
	119 |             mut gpu <- Gpu::new(
	    |             +++
	
	error: aborting due to 1 previous error

  reply	other threads:[~2026-09-28 12:15 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-27 14:44 [PATCH] gpu: nova-core: use a single try_pin_init!() block in probe() Danilo Krummrich
2026-09-28  0:23 ` Alexandre Courbot
2026-09-28 13:48   ` Danilo Krummrich
2026-09-29 20:31     ` John Hubbard
2026-09-29 20:43       ` Danilo Krummrich
2026-09-28  4:17 ` Eliot Courtney
2026-09-28 11:36 ` Gary Guo
2026-09-28 12:00   ` Danilo Krummrich
2026-09-28 12:10     ` Gary Guo
2026-09-28 12:15       ` Danilo Krummrich [this message]
2026-09-28 13:53         ` Gary Guo
2026-09-28 13:56           ` Danilo Krummrich
2026-09-29 19:12 ` Danilo Krummrich

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=DLQXWXRP3P1J.28SLFOJJQ2EDK@kernel.org \
    --to=dakr@kernel.org \
    --cc=acourbot@nvidia.com \
    --cc=aliceryhl@google.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gary@garyguo.net \
    --cc=nova-gpu@lists.linux.dev \
    /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