make amdgpu_activate() return early when called during hibernate resume
authorjsg <jsg@openbsd.org>
Tue, 14 May 2024 04:55:42 +0000 (04:55 +0000)
committerjsg <jsg@openbsd.org>
Tue, 14 May 2024 04:55:42 +0000 (04:55 +0000)
Hibernate does DVACT_QUIESCE/DVACT_SUSPEND from hibernate_resume(),
before config_process_deferred_mountroot() calls amdgpu_attachhook().

Without this change the amdgpu_device_prepare() call ends up faulting in
ttm_resource_manager_evict_all() after the
'drm/amd: Evict resources during PM ops prepare() callback'
commit from April.

earlier diff from and ok stsp@
report and bisection from florian@

sys/dev/pci/drm/amd/amdgpu/amdgpu_drv.c

index 328f10f..17038e2 100644 (file)
@@ -3665,7 +3665,7 @@ amdgpu_activate(struct device *self, int act)
        struct drm_device *dev = &adev->ddev;
        int rv = 0;
 
-       if (dev->dev == NULL || amdgpu_fatal_error)
+       if (dev->dev == NULL || amdgpu_fatal_error || adev->shutdown)
                return (0);
 
        switch (act) {