The warning emitted when the unload bundle cannot be constructed is
valid regardless of the boot method, but it was local to `Tu102`. Move
it to `Gsp::boot` so it applies to all boot methods.

Signed-off-by: Alexandre Courbot <[email protected]>
---
 drivers/gpu/nova-core/gsp/boot.rs      | 10 +++++++++-
 drivers/gpu/nova-core/gsp/hal/tu102.rs |  9 +--------
 2 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/nova-core/gsp/boot.rs 
b/drivers/gpu/nova-core/gsp/boot.rs
index 033b2ee2e2a0..5f11c8e10a0a 100644
--- a/drivers/gpu/nova-core/gsp/boot.rs
+++ b/drivers/gpu/nova-core/gsp/boot.rs
@@ -56,7 +56,15 @@ pub(crate) fn boot(
         let wpr_meta = Coherent::init(dev, GFP_KERNEL, 
GspFwWprMeta::new(&gsp_fw, &fb_layout))?;
 
         // Perform the chipset-specific boot sequence, and retrieve the unload 
bundle.
-        let unload_bundle = hal.boot(&self, &ctx, &fb_layout, &wpr_meta)?;
+        let unload_bundle = hal.boot(&self, &ctx, &fb_layout, 
&wpr_meta)?.or_else(|| {
+            dev_warn!(dev, "The GSP won't be able to unload properly on 
unbind.\n");
+            dev_warn!(
+                dev,
+                "The GPU will need to be reset before the driver can bind 
again.\n"
+            );
+
+            None
+        });
 
         let unload_guard =
             ScopeGuard::new_with_data((ctx, unload_bundle), |(ctx, 
unload_bundle)| {
diff --git a/drivers/gpu/nova-core/gsp/hal/tu102.rs 
b/drivers/gpu/nova-core/gsp/hal/tu102.rs
index ed9a3d362090..d669ce7625a8 100644
--- a/drivers/gpu/nova-core/gsp/hal/tu102.rs
+++ b/drivers/gpu/nova-core/gsp/hal/tu102.rs
@@ -283,14 +283,7 @@ fn boot(
         // be probed again.
         let unload_bundle =
             Sec2UnloadBundle::build(dev, bar, chipset, &bios, gsp_falcon, 
sec2_falcon)
-                .inspect_err(|e| {
-                    dev_warn!(dev, "Failed to prepare unload firmware: 
{:?}\n", e);
-                    dev_warn!(dev, "The GSP won't be able to unload properly 
on unbind.\n");
-                    dev_warn!(
-                        dev,
-                        "The GPU will need to be reset before the driver can 
bind again.\n"
-                    );
-                })
+                .inspect_err(|e| dev_warn!(dev, "Failed to prepare unload 
firmware: {:?}\n", e))
                 .ok()
                 .map(crate::gsp::UnloadBundle);
 

-- 
2.54.0

Reply via email to