From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C8EBFCA0FED for ; Wed, 10 Sep 2025 11:22:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8135F10E8E4; Wed, 10 Sep 2025 11:22:44 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="rFTvCaOq"; dkim-atps=neutral Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1D18F10E8E3; Wed, 10 Sep 2025 11:22:43 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id AF94D4031C; Wed, 10 Sep 2025 11:22:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6D765C4CEF0; Wed, 10 Sep 2025 11:22:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1757503362; bh=qBV3NoC25/tu8WZzqGBG1S0R2mpfNgP/GrrsWYz2kzg=; h=Date:Cc:To:From:Subject:References:In-Reply-To:From; b=rFTvCaOqMdx656zhfkMsOPXelz6ftNSU6GXJe0ONd2Jn0DWI2Mg+tqdkG72bd34WL qmN01RiUGYoYYPwYB0cVgylHfo+H5dIJP+ebbVs1XQoAQ/PCoXhEDZPfg3JnX+fLbO /h5DHSQmUA4qYQTTV4lWEl+OrEkzvex3YPYf5BYcp7MDExis/uOeLKTheUpRJVuqEI n9FDPL06VjwQehZst5gcF3+n1sB5kmYym4Hct+LUzuHTRVtcLQYLUIschxHAoEan1E 0yvL3RiVyQXYcQQCX4wtjLiVgxipcSbQDAP/Yezox966Zu9PaSbAz4vSdj0zj9XkCI KaX9aWcwmpyMw== Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Wed, 10 Sep 2025 13:22:36 +0200 Message-Id: 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" , , , , To: "Alexandre Courbot" From: "Danilo Krummrich" Subject: Re: [PATCH v3 02/11] gpu: nova-core: move GSP boot code out of `Gpu` constructor References: <20250902-nova_firmware-v3-0-56854d9c5398@nvidia.com> <20250902-nova_firmware-v3-2-56854d9c5398@nvidia.com> <843554b1-f4c5-43f5-a23b-583339708bea@kernel.org> In-Reply-To: X-BeenThere: nouveau@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Nouveau development list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: nouveau-bounces@lists.freedesktop.org Sender: "Nouveau" On Wed Sep 10, 2025 at 1:18 PM CEST, Alexandre Courbot wrote: > On Wed Sep 10, 2025 at 5:01 PM JST, Danilo Krummrich wrote: >> On Wed Sep 10, 2025 at 6:48 AM CEST, Alexandre Courbot wrote: >>> On Tue Sep 9, 2025 at 11:43 PM JST, Danilo Krummrich wrote: >>>> impl Gpu { >>>> pub(crate) fn new<'a>( >>>> dev: &'a Device, >>>> bar: &'a Bar0 >>>> devres_bar: Arc>, >>>> ) -> impl PinInit + 'a { >>>> try_pin_init(Self { >>>> bar: devres_bar, >>>> spec: Spec::new(bar)?, >>>> gsp_falcon: Falcon::::new(dev, spec.chipset)?, >>>> sec2_falcon: Falcon::::new(dev, spec.chipset)?, >>>> sysmem_flush: SysmemFlush::register(dev, bar, spec.chipse= t)? >>>> gsp <- Gsp::new(gsp_falcon, sec2_falcon, sysmem_flush)?, >>>> }) >>>> } >>>> } >>> >>> It does work. The bizareness of passing the `bar` twice aside, >> >> Yeah, but it really seems like a minor inconvinience. (Especially, since= this >> will be the only occurance of this we'll ever have.) > > It's definitely not a big deal. > >> >>> here is what it looks like when I got it to compile: >> >> This looks great! >> >>> pub(crate) fn new<'a>( >>> pdev: &'a pci::Device, >>> devres_bar: Arc>, >>> bar: &'a Bar0, >>> ) -> impl PinInit + 'a { >>> try_pin_init!(Self { >>> spec: Spec::new(bar).inspect(|spec| { >>> dev_info!( >>> pdev.as_ref(), >>> "NVIDIA (Chipset: {}, Architecture: {:?}, Revision:= {})\n", >>> spec.chipset, >>> spec.chipset.arch(), >>> spec.revision >>> ); >>> })?, >> >> + _: { >> + gfw::wait_gfw_boot_completion(bar) >> + .inspect_err(|_| dev_err!(pdev.as_ref(), "GFW boot= did not complete"))?; >> + }, >>> >>> sysmem_flush: SysmemFlush::register(pdev.as_ref(), bar, spe= c.chipset)?, >>> >>> gsp_falcon: Falcon::::new( >>> pdev.as_ref(), >>> spec.chipset, >>> bar, >>> spec.chipset > Chipset::GA100, >>> ) >>> .inspect(|falcon| falcon.clear_swgen0_intr(bar))?, >>> >>> sec2_falcon: Falcon::::new(pdev.as_ref(), spec.chipse= t, bar, true)?, >>> >> - gsp: Self::start_gsp(pdev, bar, spec.chipset, gsp_falcon, = sec2_falcon)?, >> + gsp <- Self::start_gsp(pdev, bar, spec.chipset, gsp_falcon= , sec2_falcon), >>> >>> bar: devres_bar, >>> }) >>> } >>> >>> The wait for GFW initialization had to be moved to `probe`, but that's >>> fine IMO. >> >> That's not necessary, you can keep it in Gpu::new() -- I don't see what'= s >> preventing us from that. I inserted it in the code above. > > This one didn't work for me, but maybe you have a newer version of the > internal references patch: > > error: no rules expected reserved identifier `_` > --> drivers/gpu/nova-core/gpu.rs:323:13 > | > 323 | _: { > | ^ no rules expected this token in macro call > | > note: while trying to match `)` Yeah, you also need this patch [1]. [1] https://lore.kernel.org/all/20250905140534.3328297-1-lossin@kernel.org/