<div dir="ltr">Feel free to add a reported and tested by flag<div><br></div><div>Thanks for sorting this</div></div><br><div class="gmail_quote"><div dir="ltr">On Tue, 6 Dec 2016 at 22:55 Alex Deucher <<a href="mailto:alexdeucher@gmail.com">alexdeucher@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">We can't just reuse pci_remove as there may be userspace still<br class="gmail_msg">
doing things.<br class="gmail_msg">
<br class="gmail_msg">
Bugzilla: <a href="https://bugs.freedesktop.org/show_bug.cgi?id=98638" rel="noreferrer" class="gmail_msg" target="_blank">https://bugs.freedesktop.org/show_bug.cgi?id=98638</a><br class="gmail_msg">
Bugzilla: <a href="https://bugs.freedesktop.org/show_bug.cgi?id=97980" rel="noreferrer" class="gmail_msg" target="_blank">https://bugs.freedesktop.org/show_bug.cgi?id=97980</a><br class="gmail_msg">
Signed-off-by: Alex Deucher <<a href="mailto:alexander.deucher@amd.com" class="gmail_msg" target="_blank">alexander.deucher@amd.com</a>><br class="gmail_msg">
Cc: <a href="mailto:stable@vger.kernel.org" class="gmail_msg" target="_blank">stable@vger.kernel.org</a><br class="gmail_msg">
---<br class="gmail_msg">
drivers/gpu/drm/amd/amdgpu/amdgpu.h | 1 +<br class="gmail_msg">
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 +-<br class="gmail_msg">
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 5 ++++-<br class="gmail_msg">
3 files changed, 6 insertions(+), 2 deletions(-)<br class="gmail_msg">
<br class="gmail_msg">
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h<br class="gmail_msg">
index 946dfcc..123f8152 100644<br class="gmail_msg">
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h<br class="gmail_msg">
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h<br class="gmail_msg">
@@ -1714,6 +1714,7 @@ void amdgpu_driver_postclose_kms(struct drm_device *dev,<br class="gmail_msg">
struct drm_file *file_priv);<br class="gmail_msg">
void amdgpu_driver_preclose_kms(struct drm_device *dev,<br class="gmail_msg">
struct drm_file *file_priv);<br class="gmail_msg">
+int amdgpu_suspend(struct amdgpu_device *adev);<br class="gmail_msg">
int amdgpu_device_suspend(struct drm_device *dev, bool suspend, bool fbcon);<br class="gmail_msg">
int amdgpu_device_resume(struct drm_device *dev, bool resume, bool fbcon);<br class="gmail_msg">
u32 amdgpu_get_vblank_counter_kms(struct drm_device *dev, unsigned int pipe);<br class="gmail_msg">
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c<br class="gmail_msg">
index 4701d94..8b39fd3 100644<br class="gmail_msg">
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c<br class="gmail_msg">
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c<br class="gmail_msg">
@@ -1530,7 +1530,7 @@ static int amdgpu_fini(struct amdgpu_device *adev)<br class="gmail_msg">
return 0;<br class="gmail_msg">
}<br class="gmail_msg">
<br class="gmail_msg">
-static int amdgpu_suspend(struct amdgpu_device *adev)<br class="gmail_msg">
+int amdgpu_suspend(struct amdgpu_device *adev)<br class="gmail_msg">
{<br class="gmail_msg">
int i, r;<br class="gmail_msg">
<br class="gmail_msg">
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c<br class="gmail_msg">
index 3210081..6e4e3a1 100644<br class="gmail_msg">
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c<br class="gmail_msg">
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c<br class="gmail_msg">
@@ -486,12 +486,15 @@ amdgpu_pci_remove(struct pci_dev *pdev)<br class="gmail_msg">
static void<br class="gmail_msg">
amdgpu_pci_shutdown(struct pci_dev *pdev)<br class="gmail_msg">
{<br class="gmail_msg">
+ struct drm_device *dev = pci_get_drvdata(pdev);<br class="gmail_msg">
+ struct amdgpu_device *adev = dev->dev_private;<br class="gmail_msg">
+<br class="gmail_msg">
/* if we are running in a VM, make sure the device<br class="gmail_msg">
* torn down properly on reboot/shutdown.<br class="gmail_msg">
* unfortunately we can't detect certain<br class="gmail_msg">
* hypervisors so just do this all the time.<br class="gmail_msg">
*/<br class="gmail_msg">
- amdgpu_pci_remove(pdev);<br class="gmail_msg">
+ amdgpu_suspend(adev);<br class="gmail_msg">
}<br class="gmail_msg">
<br class="gmail_msg">
static int amdgpu_pmops_suspend(struct device *dev)<br class="gmail_msg">
--<br class="gmail_msg">
2.5.5<br class="gmail_msg">
<br class="gmail_msg">
_______________________________________________<br class="gmail_msg">
amd-gfx mailing list<br class="gmail_msg">
<a href="mailto:amd-gfx@lists.freedesktop.org" class="gmail_msg" target="_blank">amd-gfx@lists.freedesktop.org</a><br class="gmail_msg">
<a href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx" rel="noreferrer" class="gmail_msg" target="_blank">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a><br class="gmail_msg">
</blockquote></div>