All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Alexandre Courbot" <acourbot@nvidia.com>
Cc: dri-devel@lists.freedesktop.org,
	"Danilo Krummrich" <dakr@kernel.org>,
	ojeda@kernel.org
Subject: Re: [PATCH v2 05/13] gpu: nova-core: gsp: move unload bundle error handling to Gsp::boot
Date: Tue, 23 Jun 2026 20:59:09 +0000	[thread overview]
Message-ID: <20260623205909.AC9C81F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260622-nova-bootcontext-v2-5-0ddeafc06f5d@nvidia.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Early boot failures unconditionally trigger false warnings about unload firmware preparation and incorrectly state a GPU reset is required.
--

commit 273d5dbf9e1e0ce85069f0026ccecdadd0a2d4fd
Author: Alexandre Courbot <acourbot@nvidia.com>

gpu: nova-core: gsp: move unload bundle error handling to Gsp::boot

This commit moves the warning for unload bundle creation failure from
the Tu102 specific implementation to Gsp::boot so it applies to all boot
methods. It changes the HAL boot method to return a Result for the
unload bundle.

> diff --git a/drivers/gpu/nova-core/gsp/boot.rs b/drivers/gpu/nova-core/gsp/boot.rs
> --- a/drivers/gpu/nova-core/gsp/boot.rs
> +++ b/drivers/gpu/nova-core/gsp/boot.rs
[ ... ]
> @@ -59,6 +59,18 @@ pub(crate) fn boot(
>          // Perform the chipset-specific boot sequence, and retrieve the unload bundle.
>          let (res, unload_bundle) = hal.boot(&self, &ctx, &fb_layout, &wpr_meta);
>  
> +        // Display error for unload bundle if any, and convert to Option.
> +        let unload_bundle = unload_bundle
> +            .inspect_err(|e| {

[Severity: Medium]
If the hal.boot() implementation fails early (for example, if Vbios::new()
fails in Tu102::boot()), unload_bundle will retain its initial dummy error
value of Err(EAGAIN).

Won't inspect_err() then unconditionally print these warnings about firmware
preparation and the need for a GPU reset, even though the actual failure
occurred before bundle preparation was attempted?

> +                dev_warn!(dev, "Failed to prepare unload firmware: {:?}\n", e);
> +                dev_warn!(dev, "The GSP won't be able to unload properly on unbind.\n");
> +                dev_warn!(
> +                    dev,
> +                    "The GPU will need to be reset before the driver can bind again.\n"
> +                );
> +            })
> +            .ok();
> +
>          // Run from a closure so we can retrieve the result, and run the unload sequence of the GSP
>          // in case of error.
>          let res = res.and_then(|()| {
[ ... ]
> diff --git a/drivers/gpu/nova-core/gsp/hal/tu102.rs b/drivers/gpu/nova-core/gsp/hal/tu102.rs
> --- a/drivers/gpu/nova-core/gsp/hal/tu102.rs
> +++ b/drivers/gpu/nova-core/gsp/hal/tu102.rs
[ ... ]
> @@ -269,14 +269,14 @@ fn boot(
>          ctx: &GspBootContext<'_>,
>          fb_layout: &FbLayout,
>          wpr_meta: &Coherent<GspFwWprMeta>,
> -    ) -> (Result, Option<crate::gsp::UnloadBundle>) {
> +    ) -> (Result, Result<crate::gsp::UnloadBundle>) {
>          let dev = ctx.dev();
>          let bar = ctx.bar;
>          let chipset = ctx.chipset;
>          let gsp_falcon = ctx.gsp_falcon;
>          let sec2_falcon = ctx.sec2_falcon;
>  
> -        let mut unload_bundle = None;
> +        let mut unload_bundle = Err(EAGAIN);
>  
>          let res = (|| {
>              let bios = Vbios::new(dev, bar)?;

[Severity: Medium]
Here is where unload_bundle defaults to Err(EAGAIN). Is there a way to
differentiate between an early boot failure where bundle creation wasn't
reached, versus an actual failure during bundle creation, so that Gsp::boot()
doesn't emit false warnings?

> @@ -287,15 +287,6 @@ fn boot(

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260622-nova-bootcontext-v2-0-0ddeafc06f5d@nvidia.com?part=5

  reply	other threads:[~2026-06-23 20:59 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-22  7:10 [PATCH v2 00/13] gpu: nova-core: consolidate and streamline GSP boot process Alexandre Courbot
2026-06-22  7:10 ` [PATCH v2 01/13] gpu: nova-core: gsp: sequencer: use GspBootContext Alexandre Courbot
2026-06-22  7:10 ` [PATCH v2 02/13] gpu: nova-core: gsp: sequencer: do not store sequence into GspSequencer Alexandre Courbot
2026-06-23 20:46   ` sashiko-bot
2026-06-22  7:10 ` [PATCH v2 03/13] gpu: nova-core: gsp: move boot code into local closure Alexandre Courbot
2026-06-22  7:59   ` Eliot Courtney
2026-06-22 18:41     ` John Hubbard
2026-06-22  7:10 ` [PATCH v2 04/13] gpu: nova-core: gsp: replace BootUnloadGuard with local handler Alexandre Courbot
2026-06-22  7:10 ` [PATCH v2 05/13] gpu: nova-core: gsp: move unload bundle error handling to Gsp::boot Alexandre Courbot
2026-06-23 20:59   ` sashiko-bot [this message]
2026-06-22  7:10 ` [PATCH v2 06/13] gpu: nova-core: gsp: make unload take GspBootContext Alexandre Courbot
2026-06-23 21:11   ` sashiko-bot
2026-06-22  7:10 ` [PATCH v2 07/13] gpu: nova-core: gsp: fold TU102 unload bundle construction into HAL method Alexandre Courbot
2026-06-22  7:10 ` [PATCH v2 08/13] gpu: nova-core: gsp: turn FWSEC execution " Alexandre Courbot
2026-06-22  7:10 ` [PATCH v2 09/13] gpu: nova-core: gsp: make use of FWSEC bootloader a property of the TU102 HAL Alexandre Courbot
2026-06-22  7:10 ` [PATCH v2 10/13] gpu: nova-core: introduce GspBootMethod Alexandre Courbot
2026-06-22  7:10 ` [PATCH v2 11/13] gpu: nova-core: avoid repeated calls to pci::Device::as_ref Alexandre Courbot
2026-06-22  7:10 ` [PATCH v2 12/13] gpu: nova-core: gsp: pass GspBootContext mutably Alexandre Courbot
2026-06-22  7:10 ` [PATCH v2 13/13] gpu: nova-core: store Fsp instance in Gpu Alexandre Courbot
2026-06-22 22:28   ` John Hubbard

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=20260623205909.AC9C81F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=acourbot@nvidia.com \
    --cc=dakr@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=ojeda@kernel.org \
    --cc=sashiko-reviews@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.