drm/amdgpu: move pci_save_state into suspend path
authorAlex Deucher <alexander.deucher@amd.com>
Fri, 4 Oct 2019 19:33:39 +0000 (14:33 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 15 Oct 2019 19:51:39 +0000 (15:51 -0400)
for amdgpu_device_suspend.  This follows the logic
in the resume path.

Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

index 75a0db394e2100710886175c281c9394b6620f5c..9532338ae16404e7685166e01fdf469683b066eb 100644 (file)
@@ -3171,8 +3171,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);