lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <DE52B15QXX0R.1FDTVD3DFBHDL@nvidia.com>
Date: Mon, 10 Nov 2025 22:51:14 +0900
From: "Alexandre Courbot" <acourbot@...dia.com>
To: "Joel Fernandes" <joelagnelf@...dia.com>,
 <linux-kernel@...r.kernel.org>, <rust-for-linux@...r.kernel.org>,
 <dri-devel@...ts.freedesktop.org>, <dakr@...nel.org>, <acourbot@...dia.com>
Cc: "Alistair Popple" <apopple@...dia.com>, "Miguel Ojeda"
 <ojeda@...nel.org>, "Alex Gaynor" <alex.gaynor@...il.com>, "Boqun Feng"
 <boqun.feng@...il.com>, "Gary Guo" <gary@...yguo.net>,
 <bjorn3_gh@...tonmail.com>, "Benno Lossin" <lossin@...nel.org>, "Andreas
 Hindborg" <a.hindborg@...nel.org>, "Alice Ryhl" <aliceryhl@...gle.com>,
 "Trevor Gross" <tmgross@...ch.edu>, "David Airlie" <airlied@...il.com>,
 "Simona Vetter" <simona@...ll.ch>, "Maarten Lankhorst"
 <maarten.lankhorst@...ux.intel.com>, "Maxime Ripard" <mripard@...nel.org>,
 "Thomas Zimmermann" <tzimmermann@...e.de>, "John Hubbard"
 <jhubbard@...dia.com>, "Timur Tabi" <ttabi@...dia.com>,
 <joel@...lfernandes.org>, <nouveau@...ts.freedesktop.org>, "Nouveau"
 <nouveau-bounces@...ts.freedesktop.org>
Subject: Re: [PATCH v2 12/12] gpu: nova-core: gsp: Wait for gsp
 initialization to complete

On Mon Nov 3, 2025 at 8:59 AM JST, Joel Fernandes wrote:
<snip>
> diff --git a/drivers/gpu/nova-core/gsp/commands.rs b/drivers/gpu/nova-core/gsp/commands.rs
> index 338d1695027f..475c6d9410c5 100644
> --- a/drivers/gpu/nova-core/gsp/commands.rs
> +++ b/drivers/gpu/nova-core/gsp/commands.rs
> @@ -4,16 +4,51 @@
>  use kernel::device;
>  use kernel::pci;
>  use kernel::prelude::*;
> -use kernel::transmute::AsBytes;
> +use kernel::time::Delta;
> +use kernel::transmute::{
> +    AsBytes,
> +    FromBytes, //
> +};
>  
>  use super::fw::commands::*;
>  use super::fw::MsgFunction;
>  use crate::driver::Bar0;
>  use crate::gsp::cmdq::Cmdq;
> -use crate::gsp::cmdq::{CommandToGsp, CommandToGspBase, CommandToGspWithPayload};
> +use crate::gsp::cmdq::{
> +    CommandToGsp,
> +    CommandToGspBase,
> +    CommandToGspWithPayload,
> +    MessageFromGsp, //
> +};
>  use crate::gsp::GSP_PAGE_SIZE;
>  use crate::sbuffer::SBufferIter;
>  
> +/// Message type for GSP initialization done notification.
> +struct GspInitDone {}
> +
> +// SAFETY: GspInitDone is a zero-sized type with no bytes, therefore it
> +// trivially has no uninitialized bytes.
> +unsafe impl AsBytes for GspInitDone {}

This implementation is not needed IIUC.

> +
> +// SAFETY: GspInitDone is a zero-sized type with no bytes, therefore it
> +// trivially has no uninitialized bytes.
> +unsafe impl FromBytes for GspInitDone {}
> +
> +impl MessageFromGsp for GspInitDone {
> +    const FUNCTION: MsgFunction = MsgFunction::GspInitDone;
> +}
> +
> +/// Waits for GSP initialization to complete.
> +pub(crate) fn gsp_init_done(cmdq: &mut Cmdq, timeout: Delta) -> Result {
> +    loop {
> +        match cmdq.receive_msg_from_gsp::<GspInitDone, ()>(timeout, |_, _| Ok(())) {
> +            Ok(_) => break Ok(()),

Here clippy complains that this should be `Ok(())`.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ