From: jsg Date: Tue, 14 May 2024 04:55:42 +0000 (+0000) Subject: make amdgpu_activate() return early when called during hibernate resume X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=bd26684b565a31e725ef043aabe4c122ee54ff56;p=openbsd 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@ --- 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) {