From 4d7fc6aed0bade5e07f2a87f59aa6f0c50b0ae62 Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Wed, 31 Oct 2018 10:05:01 -0500 Subject: [PATCH] drm/amdgpu: reset GPU on shutdown for kexec kexec requires the device to be fully reset so that the driver can load again. The only way to do this is via a GPU reset. bug: https://bugs.freedesktop.org/show_bug.cgi?id=108585 Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c index 28781414d71c..4f479d26a861 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c @@ -960,6 +960,7 @@ amdgpu_pci_shutdown(struct pci_dev *pdev) { struct drm_device *dev = pci_get_drvdata(pdev); struct amdgpu_device *adev = dev->dev_private; + int r; /* if we are running in a VM, make sure the device * torn down properly on reboot/shutdown. @@ -967,6 +968,9 @@ amdgpu_pci_shutdown(struct pci_dev *pdev) * hypervisors so just do this all the time. */ amdgpu_device_ip_suspend(adev); + r = amdgpu_asic_reset(adev); + if (r) + DRM_ERROR("amdgpu asic reset on shutdown failed\n"); } static int amdgpu_pmops_suspend(struct device *dev) -- 2.13.6