mirror of
https://github.com/torvalds/linux.git
synced 2026-09-23 22:14:03 +02:00
gpu: nova-core: add non-sec2 unload path
For non-sec2 it is only required to wait for GSP falcon to halt. This is because GSP does the main work of unloading on GPUs not using sec2. Signed-off-by: Eliot Courtney <ecourtney@nvidia.com> [ jhubbard: use Result instead of Result<()> in the UnloadBundle impl ] Signed-off-by: John Hubbard <jhubbard@nvidia.com> Link: https://patch.msgid.link/20260603-b4-blackwell-v13-8-d9f3a06939e0@nvidia.com Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
This commit is contained in:
parent
a69a9e23dc
commit
c7fea1f709
|
|
@ -29,7 +29,10 @@
|
||||||
gpu::Chipset,
|
gpu::Chipset,
|
||||||
gsp::{
|
gsp::{
|
||||||
boot::BootUnloadGuard,
|
boot::BootUnloadGuard,
|
||||||
hal::GspHal,
|
hal::{
|
||||||
|
GspHal,
|
||||||
|
UnloadBundle, //
|
||||||
|
},
|
||||||
Gsp,
|
Gsp,
|
||||||
GspFwWprMeta, //
|
GspFwWprMeta, //
|
||||||
},
|
},
|
||||||
|
|
@ -117,6 +120,28 @@ fn wait_for_gsp_lockdown_release(
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct FspUnloadBundle;
|
||||||
|
|
||||||
|
impl UnloadBundle for FspUnloadBundle {
|
||||||
|
fn run(
|
||||||
|
&self,
|
||||||
|
dev: &device::Device<device::Bound>,
|
||||||
|
bar: &Bar0,
|
||||||
|
gsp_falcon: &Falcon<GspEngine>,
|
||||||
|
_sec2_falcon: &Falcon<Sec2>,
|
||||||
|
) -> Result {
|
||||||
|
// GSP falcon does most of the work of resetting, so just wait for it to finish.
|
||||||
|
read_poll_timeout(
|
||||||
|
|| Ok(gsp_falcon.is_riscv_active(bar)),
|
||||||
|
|&active| !active,
|
||||||
|
Delta::from_millis(10),
|
||||||
|
Delta::from_secs(5),
|
||||||
|
)
|
||||||
|
.map(|_| ())
|
||||||
|
.inspect_err(|_| dev_err!(dev, "GSP falcon failed to halt\n"))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
struct Gh100;
|
struct Gh100;
|
||||||
|
|
||||||
impl GspHal for Gh100 {
|
impl GspHal for Gh100 {
|
||||||
|
|
@ -133,9 +158,18 @@ fn boot<'a>(
|
||||||
fb_layout: &FbLayout,
|
fb_layout: &FbLayout,
|
||||||
wpr_meta: &Coherent<GspFwWprMeta>,
|
wpr_meta: &Coherent<GspFwWprMeta>,
|
||||||
gsp_falcon: &'a Falcon<GspEngine>,
|
gsp_falcon: &'a Falcon<GspEngine>,
|
||||||
_sec2_falcon: &'a Falcon<Sec2>,
|
sec2_falcon: &'a Falcon<Sec2>,
|
||||||
) -> Result<BootUnloadGuard<'a>> {
|
) -> Result<BootUnloadGuard<'a>> {
|
||||||
let fsp_fw = FspFirmware::new(dev, chipset, FIRMWARE_VERSION)?;
|
let fsp_fw = FspFirmware::new(dev, chipset, FIRMWARE_VERSION)?;
|
||||||
|
|
||||||
|
let unload_bundle = crate::gsp::UnloadBundle(
|
||||||
|
KBox::new(FspUnloadBundle, GFP_KERNEL)? as KBox<dyn UnloadBundle>
|
||||||
|
);
|
||||||
|
|
||||||
|
// Wrap the unload bundle into a drop guard so it is automatically run upon failure.
|
||||||
|
let _unload_guard =
|
||||||
|
BootUnloadGuard::new(gsp, dev, bar, gsp_falcon, sec2_falcon, Some(unload_bundle));
|
||||||
|
|
||||||
let mut fsp = Fsp::wait_secure_boot(dev, bar, chipset, fsp_fw)?;
|
let mut fsp = Fsp::wait_secure_boot(dev, bar, chipset, fsp_fw)?;
|
||||||
|
|
||||||
let args = FmcBootArgs::new(
|
let args = FmcBootArgs::new(
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user