Commit faefba95 authored by Alex Deucher's avatar Alex Deucher

drm/amdgpu: just suspend the hw on pci shutdown

We can't just reuse pci_remove as there may be userspace still
doing things.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98638
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97980Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Reported-and-tested-by: default avatarMike Lothian <mike@fireburn.co.uk>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent ab7cd8d8
...@@ -2472,6 +2472,7 @@ void amdgpu_driver_postclose_kms(struct drm_device *dev, ...@@ -2472,6 +2472,7 @@ void amdgpu_driver_postclose_kms(struct drm_device *dev,
struct drm_file *file_priv); struct drm_file *file_priv);
void amdgpu_driver_preclose_kms(struct drm_device *dev, void amdgpu_driver_preclose_kms(struct drm_device *dev,
struct drm_file *file_priv); struct drm_file *file_priv);
int amdgpu_suspend(struct amdgpu_device *adev);
int amdgpu_device_suspend(struct drm_device *dev, bool suspend, bool fbcon); int amdgpu_device_suspend(struct drm_device *dev, bool suspend, bool fbcon);
int amdgpu_device_resume(struct drm_device *dev, bool resume, bool fbcon); int amdgpu_device_resume(struct drm_device *dev, bool resume, bool fbcon);
u32 amdgpu_get_vblank_counter_kms(struct drm_device *dev, unsigned int pipe); u32 amdgpu_get_vblank_counter_kms(struct drm_device *dev, unsigned int pipe);
......
...@@ -1493,7 +1493,7 @@ static int amdgpu_fini(struct amdgpu_device *adev) ...@@ -1493,7 +1493,7 @@ static int amdgpu_fini(struct amdgpu_device *adev)
return 0; return 0;
} }
static int amdgpu_suspend(struct amdgpu_device *adev) int amdgpu_suspend(struct amdgpu_device *adev)
{ {
int i, r; int i, r;
......
...@@ -479,12 +479,15 @@ amdgpu_pci_remove(struct pci_dev *pdev) ...@@ -479,12 +479,15 @@ amdgpu_pci_remove(struct pci_dev *pdev)
static void static void
amdgpu_pci_shutdown(struct pci_dev *pdev) amdgpu_pci_shutdown(struct pci_dev *pdev)
{ {
struct drm_device *dev = pci_get_drvdata(pdev);
struct amdgpu_device *adev = dev->dev_private;
/* if we are running in a VM, make sure the device /* if we are running in a VM, make sure the device
* torn down properly on reboot/shutdown. * torn down properly on reboot/shutdown.
* unfortunately we can't detect certain * unfortunately we can't detect certain
* hypervisors so just do this all the time. * hypervisors so just do this all the time.
*/ */
amdgpu_pci_remove(pdev); amdgpu_suspend(adev);
} }
static int amdgpu_pmops_suspend(struct device *dev) static int amdgpu_pmops_suspend(struct device *dev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment