drm/amdgpu: move pci_save_state into suspend path
Subsystems (2)
PATCH 1/2 drm/amdgpu: move pci_save_state into suspend path
for amdgpu_device_suspend. This follows the logic in the resume path.
Signed-off-by Alex Deucher <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +1 -1
@@ -3168,8 +3168,8 @@ int amdgpu_device_suspend(struct drm_device *dev, bool suspend, bool fbcon)*/ amdgpu_bo_evict_vram (adev); -pci_save_state (dev->pdev);if (suspend) { +pci_save_state (dev->pdev);/* Shut down the device */ pci_disable_device (dev->pdev);pci_set_power_state (dev->pdev, PCI_D3hot);
Signature · 6 lines
2.20.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 2/2 drm/amdgpu: move gpu reset out of amdgpu_device_suspend
In reply to a message not in the archiveMove it into the caller. There are cases were we don't want it. We need it for hibernation, but we don't need it for runtime pm.
Signed-off-by Alex Deucher <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ---- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 7 ++++++- 2 files changed, 6 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -4
@@ -3173,10 +3173,6 @@ int amdgpu_device_suspend(struct drm_device *dev, bool suspend, bool fbcon)/* Shut down the device */ pci_disable_device (dev->pdev);pci_set_power_state (dev->pdev, PCI_D3hot); - }else { - r =amdgpu_asic_reset (adev); -if (r) -DRM_ERROR ("amdgpu asic reset failed\n" ); }return 0 ;
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +6 -1
@@ -1118,8 +1118,13 @@ static int amdgpu_pmops_resume(struct device *dev)static int amdgpu_pmops_freeze (struct device *dev) {struct drm_device *drm_dev =dev_get_drvdata (dev); +struct amdgpu_device *adev = drm_dev->dev_private; +int r; -return amdgpu_device_suspend (drm_dev, false, true); + r =amdgpu_device_suspend (drm_dev, false, true); +if (r) +return r; +return amdgpu_asic_reset (adev); }static int amdgpu_pmops_thaw (struct device *dev)
Signature · 6 lines
2.20.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx