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 1/2] gpu: nova-core: convert to kernel bitfield macro
Date: Wed, 17 Jun 2026 14:11:39 +0000	[thread overview]
Message-ID: <20260617141140.A0FCA1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260617-nova-bitfield-v1-1-ec10c6772666@nvidia.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Refactored FSP message validation incorrectly bubbles up enum conversion errors via `?`, bypassing diagnostic logging and changing the return code from `-EIO` to `-EINVAL`.
--

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

gpu: nova-core: convert to kernel bitfield macro

This commit replaces uses of the Nova-local bitfield! macro with the
kernel one.

> diff --git a/drivers/gpu/nova-core/fsp.rs b/drivers/gpu/nova-core/fsp.rs
> index 8fc243c66e356..91885b355d462 100644
> --- a/drivers/gpu/nova-core/fsp.rs
> +++ b/drivers/gpu/nova-core/fsp.rs
[ ... ]
> @@ -274,7 +275,12 @@ fn send_sync_fsp<M>(&mut self, dev: &device::Device, bar: Bar0<'_>, msg: &M) ->
>              return Err(EIO);
>          }
>  
> -        if command_nvdm_type != u8::from(M::NVDM_TYPE).into() {
> +        if command_nvdm_type
> +            .try_into_bounded()
> +            .ok_or(EINVAL)
> +            .and_then(NvdmType::try_from)?
> +            != M::NVDM_TYPE
> +        {
>              dev_err!(
>                  dev,
>                  "Expected NVDM type {:?} in reply, got {:#x}\n",

[Severity: Medium]
Does the ? operator here prematurely return EINVAL if the firmware returns an
unknown or invalid NVDM type?

It looks like if NvdmType::try_from fails, this will immediately propagate the
error out of send_sync_fsp(). Does this bypass the dev_err! diagnostic block
below that was intended to log the unexpected hardware value?

By returning early here, this also appears to alter the original error
reporting semantics by returning EINVAL instead of the expected EIO for a
device failure.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260617-nova-bitfield-v1-0-ec10c6772666@nvidia.com?part=1

  reply	other threads:[~2026-06-17 14:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-17 14:02 [PATCH 0/2] gpu: nova-core: convert to kernel bitfield macro and remove local variant Alexandre Courbot
2026-06-17 14:02 ` [PATCH 1/2] gpu: nova-core: convert to kernel bitfield macro Alexandre Courbot
2026-06-17 14:11   ` sashiko-bot [this message]
2026-06-22  5:23   ` Eliot Courtney
2026-06-17 14:02 ` [PATCH 2/2] gpu: nova-core: remove local " Alexandre Courbot

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=20260617141140.A0FCA1F000E9@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.