Skip to content

gpu: nova-core: consolidate and streamline GSP boot process

Alexandre Courbot dri-devel lkml nova-gpu rust-for-linux 6 versions – Applied

Status from this message: Pushed to drm-rust-next! Thanks all.

Get series with b4
b4 am [email protected] change-id 20260619-nova-bootcontext-401d6107e8fb

Versions newest first

  1. v6 Latest13 patches 1 replyApplied
  2. v513 patches 7 repliesSuperseded
  3. v413 patches 13 repliesSuperseded
Earlier versions · 3
VersionPostedPatchesRepliesStatus
v312 patches1 replySuperseded
v213 patches4 repliesSuperseded
v16 patches8 repliesSuperseded

Changes in v6 from the cover letter

- Use ScopeGuard in GH100 HAL and do not wait for lockdown release on
the error path. (thanks Eliot!)
- Link to v5: https://patch.msgid.link/[email protected]

Patches in v6 Applied

#Subject and filesSizeRepliesApplied
1/13gpu: nova-core: gsp: sequencer: use GspBootContextdrivers/gpu/nova-core/gsp/hal/tu102.rs drivers/gpu/nova-core/gsp/sequencer.rs+20 -370 replies
2/13gpu: nova-core: gsp: sequencer: do not store sequence into GspSequencerdrivers/gpu/nova-core/gsp/sequencer.rs+15 -200 replies
3/13gpu: nova-core: gsp: replace BootUnloadGuard with local handlersdrivers/gpu/nova-core/gsp/boot.rs drivers/gpu/nova-core/gsp/hal.rs drivers/gpu/nova-core/gsp/hal/gh100.rs +1 more+41 -890 replies
4/13gpu: nova-core: gsp: pass GspBootContext to unload methodsdrivers/gpu/nova-core/gpu.rs drivers/gpu/nova-core/gsp/boot.rs drivers/gpu/nova-core/gsp/hal.rs +2 more+45 -570 replies
5/13gpu: nova-core: gsp: centralize missing unload bundle warningsdrivers/gpu/nova-core/gsp/boot.rs drivers/gpu/nova-core/gsp/hal/tu102.rs+10 -90 replies
6/13gpu: nova-core: gsp: fold TU102 unload bundle construction into HAL methoddrivers/gpu/nova-core/gsp/hal/tu102.rs+39 -460 replies
7/13gpu: nova-core: gsp: turn FWSEC execution into HAL methoddrivers/gpu/nova-core/gsp/hal/tu102.rs+87 -860 replies
8/13gpu: nova-core: gsp: make use of FWSEC bootloader a property of the TU102 HALdrivers/gpu/nova-core/gsp/hal.rs drivers/gpu/nova-core/gsp/hal/ga102.rs drivers/gpu/nova-core/gsp/hal/tu102.rs+29 -50 replies
9/13gpu: nova-core: move GSP firmware files decision to GSP HALdrivers/gpu/nova-core/firmware.rs drivers/gpu/nova-core/firmware/fwsec.rs drivers/gpu/nova-core/gpu.rs +2 more+33 -330 replies
10/13gpu: nova-core: avoid repeated calls to pci::Device::as_refdrivers/gpu/nova-core/gpu.rs+13 -110 replies
11/13gpu: nova-core: gsp: pass GspBootContext mutablydrivers/gpu/nova-core/gsp/boot.rs drivers/gpu/nova-core/gsp/hal.rs drivers/gpu/nova-core/gsp/hal/gh100.rs +1 more+28 -210 replies
12/13gpu: nova-core: gsp: separate context and GPU lifetimes in GspBootContextdrivers/gpu/nova-core/gsp.rs drivers/gpu/nova-core/gsp/boot.rs drivers/gpu/nova-core/gsp/hal.rs +3 more+28 -180 replies
13/13gpu: nova-core: store Fsp instance in Gpudrivers/gpu/nova-core/fsp.rs drivers/gpu/nova-core/gpu.rs drivers/gpu/nova-core/gsp.rs +1 more+38 -130 replies

Reviews trailers per patch

12 of 13 patches have a Reviewed-by or Acked-by.

PatchEliot Courtney
1/13R-b
2/13R-b
3/13R-b
4/13R-b
5/13R-b
6/13R-b
7/13R-b
8/13R-b
9/13
10/13R-b
11/13R-b
12/13R-b
13/13R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v6 thread

Cover letter [PATCH v6 00/13] gpu: nova-core: consolidate and streamline GSP boot process

The recently introduced GspBootContext is useful in at least two other places:

- As a replacement for the sequencer's GspSequencerParams,
- As the main parameter of Gsp::unload, for symmetry with Gsp::boot.

This symmetry can be further exploited to make Gsp::boot and Gsp::unload generic over the exact boot context required for the current chip. Doing so requires some more preliminary work that goes beyond this series, but this groundwork is needed regardless.

Another cleanup that can be performed as a consequence is the removal of the BootUnloadGuard. This type is cumbersome as it holds extra references to the boot context, making it difficult to make some of these references mutable (as we want to do with the Falcons that should require exclusive access to load and run firmware). Furthermore, it is only needed a single time in Gsp::boot, and is inadequate for handling errors occurring in HALs.

Based on Eliot's feedback on v4, the series then removes the last remnants of the boot procedure leaking outside of the HALs, and consolidates everything within the GSP and FSP HALs.

This series applies on the latest drm-rust-next.

---
Changes in v6:
- Use ScopeGuard in GH100 HAL and do not wait for lockdown release on
the error path. (thanks Eliot!)
- Link to v5: https://patch.msgid.link/[email protected]

Changes in v5:
- Make GH100's HAL wait on both GSP lockdown release and GSP RISC-V halt
in case of error.
- Drop GspBootMethod and use HAL abstractions to cover differences in
boot procedures. (thanks Eliot!)
- Stylistic improvement in TU102 HAL.
- Convert more pdev -> dev in gpu.rs.
- Link to v4: https://patch.msgid.link/[email protected]

Changes in v4:
- Rebase on top of latest drm-rust-next.
- Add preparatory patch to separate the different lifetimes at play in GspBootContext.
- Link to v3: https://patch.msgid.link/[email protected]

Changes in v3:
- Drop the preparatory closure-only patch.
- Use ScopeGuard for GSP boot-error cleanup.
- Keep TU102 boot-error cleanup local to the HAL.
- Avoid spurious unload-bundle warnings on early failures.
- Keep GH100 FMC boot arguments alive through lockdown release.
- Link to v2: https://patch.msgid.link/[email protected]

Changes in v2:
- Replace nonexistent ENODATA with the more appropriate EAGAIN.
- Add patches introducing GspBootMethod.
- Add patches moving Fsp to Gpu.
- Link to v1: https://patch.msgid.link/[email protected]

---
Alexandre Courbot (12):
gpu: nova-core: gsp: sequencer: use GspBootContext
gpu: nova-core: gsp: sequencer: do not store sequence into GspSequencer
gpu: nova-core: gsp: replace BootUnloadGuard with local handlers
gpu: nova-core: gsp: pass GspBootContext to unload methods
gpu: nova-core: gsp: centralize missing unload bundle warnings
gpu: nova-core: gsp: fold TU102 unload bundle construction into HAL method
gpu: nova-core: gsp: turn FWSEC execution into HAL method
gpu: nova-core: gsp: make use of FWSEC bootloader a property of the TU102 HAL
gpu: nova-core: avoid repeated calls to pci::Device::as_ref
gpu: nova-core: gsp: pass GspBootContext mutably
gpu: nova-core: gsp: separate context and GPU lifetimes in GspBootContext
gpu: nova-core: store Fsp instance in Gpu

Eliot Courtney (1):
gpu: nova-core: move GSP firmware files decision to GSP HAL

 drivers/gpu/nova-core/firmware.rs       |  25 ++-
 drivers/gpu/nova-core/firmware/fwsec.rs |   5 +-
 drivers/gpu/nova-core/fsp.rs            |  21 +-
 drivers/gpu/nova-core/gpu.rs            |  68 ++++---
 drivers/gpu/nova-core/gsp.rs            |  22 ++-
 drivers/gpu/nova-core/gsp/boot.rs       |  99 +++-------
 drivers/gpu/nova-core/gsp/hal.rs        |  59 +++---
 drivers/gpu/nova-core/gsp/hal/ga102.rs  |  14 ++
 drivers/gpu/nova-core/gsp/hal/gh100.rs  |  53 +++--
 drivers/gpu/nova-core/gsp/hal/tu102.rs  | 330 ++++++++++++++++----------------
 drivers/gpu/nova-core/gsp/sequencer.rs  |  71 +++----
 11 files changed, 374 insertions(+), 393 deletions(-)

---
base-commit: d85845b64c0020b2812243a22fa79d57cc1c1e38
change-id: 20260619-nova-bootcontext-401d6107e8fb

Best regards,

Signature · 1 line
Alexandre Courbot <[email protected]>