Doing S3 stress test, sometimes, driver can not get console lock. So use console_trylock() to instead it. Change-Id: I50177f3d7dbb923cb4f602a11ea51c397b12b3e6 Signed-off-by: JimQu <Jim.Qu at amd.com> --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index 087e520..bd5387d 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -1889,9 +1889,6 @@ int amdgpu_resume_kms(struct drm_device *dev, bool resume, bool fbcon) if (dev->switch_power_state == DRM_SWITCH_POWER_OFF) return 0; - if (fbcon) { - console_lock(); - } if (resume) { pci_set_power_state(dev->pdev, PCI_D0); pci_restore_state(dev->pdev); @@ -1989,6 +1986,8 @@ int amdgpu_resume_kms(struct drm_device *dev, bool resume, bool fbcon) #endif if (fbcon) { + if (!console_trylock()) + return 0; amdgpu_fbdev_set_suspend(adev, 0); console_unlock(); } -- 1.9.1