From bd26684b565a31e725ef043aabe4c122ee54ff56 Mon Sep 17 00:00:00 2001 From: jsg Date: Tue, 14 May 2024 04:55:42 +0000 Subject: [PATCH] make amdgpu_activate() return early when called during hibernate resume 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/pci/drm/amd/amdgpu/amdgpu_drv.c b/sys/dev/pci/drm/amd/amdgpu/amdgpu_drv.c index 328f10f9a0d..17038e2472d 100644 --- a/sys/dev/pci/drm/amd/amdgpu/amdgpu_drv.c +++ b/sys/dev/pci/drm/amd/amdgpu/amdgpu_drv.c @@ -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) { -- 2.20.1