From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 6E5B019A; Thu, 11 Sep 2025 11:22:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757589745; cv=none; b=G/gqUNEi1UwLRHtwW4gZPIkhEYNONRDN+R+aTGG/ZTMKlpuSOBT1g4A/+k6K3QyAPqJfD2djN0z5QXuth/WvWc3+UuwTvlJYzjzBoRjkIRUpHg1wCA9ID3eXnJu133ihWbxUIvBv+ziK2OVfF6a1lX1SNOIjqEudelMpBFC7PxY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757589745; c=relaxed/simple; bh=OwvNjx3MRUK1frkNA0c5zRPid8ek62rk22oqfoMLxHY=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Wk/XghmqWk/JKs5O20+vgv8M1iUlzrisCEDsuHq/cWEk/Ys7VZLJr09Q2Qu1GIqdB2erwHnC63VK5cZXz550mkJGw1SznkZorF+iRKnMVneVGxHocPV8e6O7g+eqRjkXrcfLIPrd7Wr61GqP8M+D7J/9zBvlWOmfaSQjD0IWnwA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=MTAJ8j9z; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="MTAJ8j9z" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9D1D8C4CEF0; Thu, 11 Sep 2025 11:22:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1757589745; bh=OwvNjx3MRUK1frkNA0c5zRPid8ek62rk22oqfoMLxHY=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=MTAJ8j9zIniFTiMbgJwfxoxWSqAeEuZQZvcZjkLuJgm4hwqQ+mriuqj2bEnCeKppv C+QPs1IAEMfGr92mBUxNlBatB3XQfH/2tKcQjvazLWSzXDk4YNbzA0H3TIq9C6SbEE jiTYVOtyQMlpwFZOyBlZIgWK1YY9P4w1tKKNgzHCITLNWqoVxkJP0Aqf1aUEPQDvTx r5/blIC3ocgnhDO/EikLhbEY1uI1Glp5Ve8DHACr0yiFIc4/S7r2Ashp+Tznke5WdI Iwl8QRMMKEonngJqTd3g4IJRFYramlK8b5mgJjb9pe/EFy/lNCl/FOY6tKBM6DekNu d6j2h/au4vXuQ== Message-ID: Date: Thu, 11 Sep 2025 13:22:18 +0200 Precedence: bulk X-Mailing-List: rust-for-linux@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v5 02/12] gpu: nova-core: move GSP boot code to a dedicated method To: Alexandre Courbot Cc: Miguel Ojeda , Alex Gaynor , Boqun Feng , Gary Guo , =?UTF-8?Q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl , Trevor Gross , David Airlie , Simona Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , John Hubbard , Alistair Popple , Joel Fernandes , Timur Tabi , rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org References: <20250911-nova_firmware-v5-0-5a8a33bddca1@nvidia.com> <20250911-nova_firmware-v5-2-5a8a33bddca1@nvidia.com> From: Danilo Krummrich Content-Language: en-US In-Reply-To: <20250911-nova_firmware-v5-2-5a8a33bddca1@nvidia.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 9/11/25 1:04 PM, Alexandre Courbot wrote: > + /// Attempt to start the GSP. > + /// > + /// This is a GPU-dependent and complex procedure that involves loading firmware files from > + /// user-space, patching them with signatures, and building firmware-specific intricate data > + /// structures that the GSP will use at runtime. > + /// > + /// Upon return, the GSP is up and running, and its runtime object given as return value. > + pub(crate) fn start_gsp( > + pdev: &pci::Device, > + bar: &Bar0, > + chipset: Chipset, > + gsp_falcon: &Falcon, > + _sec2_falcon: &Falcon, > + ) -> Result<()> {> + let dev = pdev.as_ref(); > + > + let bios = Vbios::new(dev, bar)?; > + > + let fb_layout = FbLayout::new(chipset, bar)?; > + dev_dbg!(dev, "{:#x?}\n", fb_layout); > + > + Self::run_fwsec_frts(dev, gsp_falcon, bar, &bios, &fb_layout)?; > + > + // Return an empty placeholder for now, to be replaced with the GSP runtime data. > + Ok(()) > + } I'd rather create the Gsp structure already, move the code to Gsp::new() and return an impl PinInit. If you don't want to store any of the object instances you create above yet, you can just stuff all the code into an initializer code block, as you do in the next patch with gfw::wait_gfw_boot_completion().