From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9DB381F427C for ; Mon, 28 Sep 2026 12:15:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790597717; cv=none; b=Mqxob/TgQO5g5M/6zxTNsIlFHsBN7q9SVaU3QVcr8VMtOIHBa8+JFNy8TQtxswWBRwkm4Xg+sKvtvUtR61XF6n0h8JdaYuVJ7I3nybfy1i1GDa1nmO8zva5HKx3z4SCgVJ4dGMMCA4IhgK7lKHy6PzkbiOzI4caUcQvMTagMkkU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790597717; c=relaxed/simple; bh=aXSz+q/wYskVScGqjVO6heGe6qKgoRlKzVu9h0SQ5Wo=; h=Mime-Version:Content-Type:Date:Message-Id:Subject:Cc:To:From: References:In-Reply-To; b=pallloDUxqTyeNILiY3CxbMIJBoyDgUZP5vokp4j96FPhYAuoRtIQn/6SRCC7VGr4a5QDi88W00lrgnxPeeD4IywVqx9glK5T0HTbXJFDJ+iiZ6s6ulIwDDIw1MaJwv7R03yIWv/4/aycohG9mJ+wGcWTR7EVgbeF4jD0fvPvSc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=B5Q4e80Q; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="B5Q4e80Q" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 526A21F000FF; Mon, 28 Sep 2026 12:15:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1790597716; bh=HDe6ouDH2NewJUwwqo4l3PMqfR3AF+iTbUPvWV57SaM=; h=Date:Subject:Cc:To:From:References:In-Reply-To; b=B5Q4e80QkWzex+4GkzBEcZCsdU13+v85Y0pZBrq4Yx5u0vi4HUoYYNSKFLtluIq/h ua+9qD3RmcRpFwrXsyuYy1WyH7DsdSegltYaC8dJtiqHXuoJJLU6t3EwPqy1t53ZBL VtvNFz3uKmuA7BAi5ICMVrwEdKxwvS/rdnodgMYXA0soI5SFwqrpegGoFMUBpFYX1b eiwGv00smtL09d0/OYdQXQVdOcE0MR1oq5VtUBrp1quJXA4j61XYsBZgfbVycBGqxM LffCwp6BtWAP5eXGhbCrmCXfOkOvVI18dOwmiYwj7OUTnuRYTuuySgTg3KTjRXdZwh K1L4A9ezd+K8g== Precedence: bulk X-Mailing-List: nova-gpu@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Mon, 28 Sep 2026 14:15:13 +0200 Message-Id: Subject: Re: [PATCH] gpu: nova-core: use a single try_pin_init!() block in probe() Cc: , , , To: "Gary Guo" From: "Danilo Krummrich" References: <20260927144417.1280385-1-dakr@kernel.org> In-Reply-To: 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::Pi= n<&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 mut= able --> 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( | +++ =09 error: aborting due to 1 previous error