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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <DE98DJVBAXAL.2HUDNUC2SE6MM@nvidia.com>
Date: Sat, 15 Nov 2025 20:27:18 +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>, "Danilo Krummrich" <dakr@...nel.org>,
 "Alexandre Courbot" <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>, "Daniel Almeida" <daniel.almeida@...labora.com>,
 <nouveau@...ts.freedesktop.org>, "Lyude Paul" <lyude@...hat.com>,
 "dri-devel" <dri-devel-bounces@...ts.freedesktop.org>
Subject: Re: [PATCH v5 03/13] gpu: nova-core: falcon: Move mbox
 functionalities into helper

On Sat Nov 15, 2025 at 4:55 AM JST, Joel Fernandes wrote:
> Move falcon reading/writing to mbox functionality into helper so we can
> use it from the sequencer resume flow.
>
> Reviewed-by: Lyude Paul <lyude@...hat.com>
> Signed-off-by: Joel Fernandes <joelagnelf@...dia.com>
> ---
>  drivers/gpu/nova-core/falcon.rs | 51 +++++++++++++++++++++++----------
>  1 file changed, 36 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/gpu/nova-core/falcon.rs b/drivers/gpu/nova-core/falcon.rs
> index 30af7fc2814d..5c9f054a0f42 100644
> --- a/drivers/gpu/nova-core/falcon.rs
> +++ b/drivers/gpu/nova-core/falcon.rs
> @@ -578,19 +578,13 @@ pub(crate) fn start(&self, bar: &Bar0) -> Result<()> {
>          Ok(())
>      }
>  
> -    /// Start running the loaded firmware.
> -    ///
> -    /// `mbox0` and `mbox1` are optional parameters to write into the `MBOX0` and `MBOX1` registers
> -    /// prior to running.
> -    ///
> -    /// Wait up to two seconds for the firmware to complete, and return its exit status read from
> -    /// the `MBOX0` and `MBOX1` registers.
> -    pub(crate) fn boot(
> +    /// Writes values to the mailbox registers if provided.
> +    pub(crate) fn write_mailboxes(
>          &self,
>          bar: &Bar0,
>          mbox0: Option<u32>,
>          mbox1: Option<u32>,
> -    ) -> Result<(u32, u32)> {
> +    ) -> Result<()> {
>          if let Some(mbox0) = mbox0 {
>              regs::NV_PFALCON_FALCON_MAILBOX0::default()
>                  .set_value(mbox0)
> @@ -602,18 +596,45 @@ pub(crate) fn boot(
>                  .set_value(mbox1)
>                  .write(bar, &E::ID);
>          }
> +        Ok(())
> +    }
>  
> -        self.start(bar)?;
> -        self.wait_till_halted(bar)?;
> +    /// Reads the value from `mbox0` register.
> +    pub(crate) fn read_mailbox0(&self, bar: &Bar0) -> Result<u32> {

None of these methods can ever fail, so there is no need to return a
`Result` here. I'll make them infallible when applying.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ