On 10/08/16 12:04 PM, jimqu wrote: > Doing S3 stress test, sometimes, driver can not get console lock. So use > console_trylock() to instead it. This raises some questions: > 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(); > - } What else is holding console_lock at this time? > @@ -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(); > } Do virtual terminals controlled by fbcon actually work if we don't call amdgpu_fbdev_set_suspend(adev, 0) here? -- Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer