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 C2491312802; Thu, 11 Sep 2025 12:31:21 +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=1757593881; cv=none; b=D00SIzP7npoAEuUMrHPb79tK+0yU7XZAmOUtPEsuTiCMjw9sqFKqi1hlPI5z0DL0OoWrOIcaLreNCHGNi9YXWTsEzsxUVvu729uznUaviPiJ2g7/wRP+3ZjtR4ghMcYGfJtgsYjl0rgmjkXpgUAswhxile78htSDx1/+f813SBI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757593881; c=relaxed/simple; bh=K6b51fWzAg1h8jw+QOy5A/3DHSmlmOFYyUDsQ8bcEy0=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=J8xoiOcLxYsTl3lTwzEnc8zrHYqaopFCbZb7C+kZWUxWnB8r67MzOwMBWQaJwzTugufzrztWEbL49JWorbT48ydCbz6Fd2fZoVwMlf0uVBchlAfWisegS3KGlUMeZCo3jtbcFNoFxyy9vC/0sogHNDz5IRUaYhLRqJrur48tMus= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=c06Sp8Q/; 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="c06Sp8Q/" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DB09DC4CEF0; Thu, 11 Sep 2025 12:31:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1757593881; bh=K6b51fWzAg1h8jw+QOy5A/3DHSmlmOFYyUDsQ8bcEy0=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=c06Sp8Q/kv38/w351LhzH0bADeXIM27LzqOFWz+Nh46SiZueL60fgJC4Rsgoz1KYU lRoLc+FftCVZ+0Pz3zvuX7rtHL2L7LB2aWIBKuRpEQew3EqwhUasBxx20uyhfLyvif RmYeAS76hFZCosqOuSdEAwzU85otiOLypPQaEbSO+liL8POvXQRC+b4I0QvPVVvwHX qxdnjMyvYqOZCq6uCLI9TGGYS4rg0qIVoGYx69kCIgV8JEqQf1AlGPS3C6j6CwnDvB XQf5DeXP5Ykz3KAfTGuZ88nC2rjugKax/rip1CWx/eJ9ju7qdnNhsEcexIACZjx/6s uu7QwZIZ7oTWg== Message-ID: Date: Thu, 11 Sep 2025 14:31:13 +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 08/12] gpu: nova-core: firmware: process and prepare the GSP firmware 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-8-5a8a33bddca1@nvidia.com> <9c1a7902-4e14-4b25-ba32-57a475a0bccc@kernel.org> From: Danilo Krummrich Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 9/11/25 2:29 PM, Alexandre Courbot wrote: > On Thu Sep 11, 2025 at 8:27 PM JST, Danilo Krummrich wrote: >> On 9/11/25 1:04 PM, Alexandre Courbot wrote: >>> diff --git a/drivers/gpu/nova-core/gpu.rs b/drivers/gpu/nova-core/gpu.rs >>> index 06a7ee8f4195759fb55ad483852724bb1ab46793..8505ee81c43e7628d1f099aff285244f8908c633 100644 >>> --- a/drivers/gpu/nova-core/gpu.rs >>> +++ b/drivers/gpu/nova-core/gpu.rs >>> @@ -8,6 +8,7 @@ >>> use crate::fb::SysmemFlush; >>> use crate::firmware::booter::{BooterFirmware, BooterKind}; >>> use crate::firmware::fwsec::{FwsecCommand, FwsecFirmware}; >>> +use crate::firmware::gsp::GspFirmware; >>> use crate::firmware::{Firmware, FIRMWARE_VERSION}; >>> use crate::gfw; >>> use crate::regs; >>> @@ -285,6 +286,11 @@ pub(crate) fn start_gsp( >>> >>> let bios = Vbios::new(dev, bar)?; >>> >>> + let _gsp_fw = KBox::pin_init( >>> + GspFirmware::new(dev, chipset, FIRMWARE_VERSION)?, >>> + GFP_KERNEL, >>> + )?; >> >> Since we now have the infrastructure in place and the change is trival, I'd >> prefer to make this a member of struct Gsp and make it part of the Gpu structure >> directly (without separate allocation). >> >> Should we need dynamic dispatch in the future, it's also trivial to make it its >> own allocation again, but maybe we also get around the dyn dispatch. :) > > Ah, my previous talk about dynamic dispatch is a bit obsolete now that > the `Firmware` struct is gone. :) Sorry if that created confusion. > > Truth is, this object is not supposed to survive `start_gsp`, and we can > dispose of it after the GSP is started as the bootloader will have > validated and copied it into the WPR region. So we don't want to store > it into `Gpu`, now or ever. Ah, makes sense, so that's fine then.