[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e909920d-904d-4527-bb7a-af1075b91bbf@nvidia.com>
Date: Wed, 12 Nov 2025 19:49:10 -0500
From: Joel Fernandes <joelagnelf@...dia.com>
To: Lyude Paul <lyude@...hat.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, Daniel Almeida <daniel.almeida@...labora.com>,
nouveau@...ts.freedesktop.org
Subject: Re: [PATCH v3 10/14] gpu: nova-core: sequencer: Implement basic core
operations
On 11/11/2025 4:12 PM, Lyude Paul wrote:
> On Thu, 2025-11-06 at 18:11 -0500, Joel Fernandes wrote:
>> These opcodes implement various falcon-related boot operations: reset,
>> start, wait-for-halt.
>>
>> Signed-off-by: Joel Fernandes <joelagnelf@...dia.com>
>> ---
>> drivers/gpu/nova-core/gsp/sequencer.rs | 27 ++++++++++++++++++++++++++
>> 1 file changed, 27 insertions(+)
>>
>> diff --git a/drivers/gpu/nova-core/gsp/sequencer.rs b/drivers/gpu/nova-core/gsp/sequencer.rs
>> index 17118967a8d4..0192ac61df4c 100644
>> --- a/drivers/gpu/nova-core/gsp/sequencer.rs
>> +++ b/drivers/gpu/nova-core/gsp/sequencer.rs
>> @@ -49,6 +49,9 @@ pub(crate) enum GspSeqCmd {
>> RegPoll(fw::GSP_SEQ_BUF_PAYLOAD_REG_POLL),
>> DelayUs(fw::GSP_SEQ_BUF_PAYLOAD_DELAY_US),
>> RegStore(fw::GSP_SEQ_BUF_PAYLOAD_REG_STORE),
>> + CoreReset,
>> + CoreStart,
>> + CoreWaitForHalt,
>> }
>>
>> impl GspSeqCmd {
>> @@ -75,6 +78,11 @@ pub(crate) fn from_fw_cmd(cmd: &fw::GSP_SEQUENCER_BUFFER_CMD) -> Result<Self> {
>> // SAFETY: We're using the union field that corresponds to the opCode.
>> Ok(GspSeqCmd::RegStore(unsafe { cmd.payload.regStore }))
>> }
>> + fw::GSP_SEQ_BUF_OPCODE_GSP_SEQ_BUF_OPCODE_CORE_RESET => Ok(GspSeqCmd::CoreReset),
>> + fw::GSP_SEQ_BUF_OPCODE_GSP_SEQ_BUF_OPCODE_CORE_START => Ok(GspSeqCmd::CoreStart),
>> + fw::GSP_SEQ_BUF_OPCODE_GSP_SEQ_BUF_OPCODE_CORE_WAIT_FOR_HALT => {
>> + Ok(GspSeqCmd::CoreWaitForHalt)
>> + }
>> _ => Err(EINVAL),
>> }
>> }
>> @@ -96,6 +104,9 @@ pub(crate) fn new(data: &[u8], dev: &device::Device<device::Bound>) -> Result<Se
>> pub(crate) fn size_bytes(&self) -> usize {
>> let opcode_size = size_of::<fw::GSP_SEQ_BUF_OPCODE>();
>> match self {
>> + // Each simple command type just adds 4 bytes (opcode_size) for the header.
>> + GspSeqCmd::CoreReset | GspSeqCmd::CoreStart | GspSeqCmd::CoreWaitForHalt => opcode_size,
>> +
>> // For commands with payloads, add the payload size in bytes.
>> GspSeqCmd::RegWrite(_) => opcode_size + size_of::<fw::GSP_SEQ_BUF_PAYLOAD_REG_WRITE>(),
>> GspSeqCmd::RegModify(_) => {
>> @@ -200,6 +211,22 @@ fn run(&self, seq: &GspSequencer<'_>) -> Result {
>> GspSeqCmd::RegPoll(cmd) => cmd.run(seq),
>> GspSeqCmd::DelayUs(cmd) => cmd.run(seq),
>> GspSeqCmd::RegStore(cmd) => cmd.run(seq),
>> + GspSeqCmd::CoreReset => {
>> + dev_dbg!(seq.dev, "CoreReset\n");
>> + seq.gsp_falcon.reset(seq.bar)?;
>> + seq.gsp_falcon.dma_reset(seq.bar);
>> + Ok(())
>> + }
>> + GspSeqCmd::CoreStart => {
>> + dev_dbg!(seq.dev, "CoreStart\n");
>> + seq.gsp_falcon.start(seq.bar)?;
>> + Ok(())
>> + }
>> + GspSeqCmd::CoreWaitForHalt => {
>> + dev_dbg!(seq.dev, "CoreWaitForHalt\n");
>> + seq.gsp_falcon.wait_till_halted(seq.bar)?;
>> + Ok(())
>
> Are we still planning on getting rid of these dev_dbg! calls?
>
Yes, already done for v4 and posting soon.
Thanks.
Powered by blists - more mailing lists