Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

gpu: nova-core: falcon: Move waiting until halted to a helper

Move the "waiting until halted" functionality into a helper so that we
can use it in the sequencer, which is a separate sequencer operation.

Reviewed-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Joel Fernandes <joelagnelf@nvidia.com>
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Message-ID: <20251114195552.739371-2-joelagnelf@nvidia.com>

authored by

Joel Fernandes and committed by
Alexandre Courbot
2d981773 38b7cc44

+14 -7
+14 -7
drivers/gpu/nova-core/falcon.rs
··· 551 551 Ok(()) 552 552 } 553 553 554 + /// Wait until the falcon CPU is halted. 555 + pub(crate) fn wait_till_halted(&self, bar: &Bar0) -> Result<()> { 556 + // TIMEOUT: arbitrarily large value, firmwares should complete in less than 2 seconds. 557 + read_poll_timeout( 558 + || Ok(regs::NV_PFALCON_FALCON_CPUCTL::read(bar, &E::ID)), 559 + |r| r.halted(), 560 + Delta::ZERO, 561 + Delta::from_secs(2), 562 + )?; 563 + 564 + Ok(()) 565 + } 566 + 554 567 /// Runs the loaded firmware and waits for its completion. 555 568 /// 556 569 /// `mbox0` and `mbox1` are optional parameters to write into the `MBOX0` and `MBOX1` registers ··· 598 585 .write(bar, &E::ID), 599 586 } 600 587 601 - // TIMEOUT: arbitrarily large value, firmwares should complete in less than 2 seconds. 602 - read_poll_timeout( 603 - || Ok(regs::NV_PFALCON_FALCON_CPUCTL::read(bar, &E::ID)), 604 - |r| r.halted(), 605 - Delta::ZERO, 606 - Delta::from_secs(2), 607 - )?; 588 + self.wait_till_halted(bar)?; 608 589 609 590 let (mbox0, mbox1) = ( 610 591 regs::NV_PFALCON_FALCON_MAILBOX0::read(bar, &E::ID).value(),