drm/amdgpu: move poll enabled/disable into non DC path
Subsystems (2)
PATCH 1/2 drm/amdgpu: move poll enabled/disable into non DC path
Some amd asics having reliable hotplug support don't call drm_kms_helper_poll_init in driver init sequence. However, due to the unified suspend/resume path for all asics, because the output_poll_work->func is not set for these asics, a warning arrives when suspending.
[ 90.656049] <TASK> [ 90.656050] ? console_unlock+0x4d/0x100 [ 90.656053] ? __irq_work_queue_local+0x27/0x60 [ 90.656056] ? irq_work_queue+0x2b/0x50 [ 90.656057] ? __wake_up_klogd+0x40/0x60 [ 90.656059] __cancel_work_timer+0xed/0x180 [ 90.656061] drm_kms_helper_poll_disable.cold+0x1f/0x2c [drm_kms_helper] [ 90.656072] amdgpu_device_suspend+0x81/0x170 [amdgpu] [ 90.656180] amdgpu_pmops_runtime_suspend+0xb5/0x1b0 [amdgpu] [ 90.656269] pci_pm_runtime_suspend+0x61/0x1b0
drm_kms_helper_poll_enable/disable is valid when poll_init is called in amdgpu code, which is only used in non DC path. So move such codes into non-DC path code to get rid of such warnings.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ---- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 4 ++++ 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -4
@@ -4145,8 +4145,6 @@ int amdgpu_device_suspend(struct drm_device *dev, bool fbcon)if (amdgpu_acpi_smart_shift_update (dev,AMDGPU_SS_DEV_D3 ))DRM_WARN ("smart shift update failed\n" ); -drm_kms_helper_poll_disable (dev); -if (fbcon)drm_fb_helper_set_suspend_unlocked (adev_to_drm (adev)->fb_helper, true);
@@ -4243,8 +4241,6 @@ int amdgpu_device_resume(struct drm_device *dev, bool fbcon)if (fbcon)drm_fb_helper_set_suspend_unlocked (adev_to_drm (adev)->fb_helper, false); -drm_kms_helper_poll_enable (dev); -amdgpu_ras_resume (adev);if (adev->mode_info.num_crtc) {
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +4 -0
@@ -1618,6 +1618,8 @@ int amdgpu_display_suspend_helper(struct amdgpu_device *adev)struct drm_connector_list_iter iter;int r; +drm_kms_helper_poll_disable (dev); +/* turn off display hw */ drm_modeset_lock_all (dev);drm_connector_list_iter_begin (dev, &iter);
@@ -1694,6 +1696,8 @@ int amdgpu_display_resume_helper(struct amdgpu_device *adev)drm_modeset_unlock_all (dev); +drm_kms_helper_poll_enable (dev); +return 0 ; }
Signature · 1 line
2.25.1
Quoted 22 lines · Guchun Chen
Some amd asics having reliable hotplug support don't call
drm_kms_helper_poll_initin driver init sequence. However, due to the unified suspend/resume path for all asics, because theoutput_poll_work->funcis not set for these asics, a warning arrives when suspending.[ 90.656049] <TASK> [ 90.656050] ? console_unlock+0x4d/0x100 [ 90.656053] ? __irq_work_queue_local+0x27/0x60 [ 90.656056] ? irq_work_queue+0x2b/0x50 [ 90.656057] ? __wake_up_klogd+0x40/0x60 [ 90.656059] __cancel_work_timer+0xed/0x180 [ 90.656061] drm_kms_helper_poll_disable.cold+0x1f/0x2c [drm_kms_helper] [ 90.656072] amdgpu_device_suspend+0x81/0x170 [amdgpu] [ 90.656180] amdgpu_pmops_runtime_suspend+0xb5/0x1b0 [amdgpu] [ 90.656269] pci_pm_runtime_suspend+0x61/0x1b0drm_kms_helper_poll_enable/disable is valid when
poll_initis called in amdgpu code, which is only used in non DC path. So move such codes into non-DC path code to get rid of such warnings.
Quoted 6 lines
Fixes a4e771729a51("drm/probe_helper: sort out poll_running vs poll_enabled")Reported-by Bert Karwatzki <[email protected]>Suggested-by Dmitry Baryshkov <[email protected]>Suggested-by Alex Deucher <[email protected]>Signed-off-by Guchun Chen <[email protected]>
Quoted 52 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ---- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 4 ++++ 2 files changed, 4 insertions(+), 4 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0
-4@@ -4145,8 +4145,6 @@ int amdgpu_device_suspend(struct drm_device *dev, bool fbcon)if (amdgpu_acpi_smart_shift_update (dev,AMDGPU_SS_DEV_D3 ))DRM_WARN ("smart shift update failed\n" ); -drm_kms_helper_poll_disable (dev); -if (fbcon)drm_fb_helper_set_suspend_unlocked (adev_to_drm (adev)->fb_helper, true);@@ -4243,8 +4241,6 @@ int amdgpu_device_resume(struct drm_device *dev, bool fbcon)if (fbcon)drm_fb_helper_set_suspend_unlocked (adev_to_drm (adev)->fb_helper, false); -drm_kms_helper_poll_enable (dev); -amdgpu_ras_resume (adev);if (adev->mode_info.num_crtc) {drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +4
-1@@ -1618,6 +1618,8 @@ int amdgpu_display_suspend_helper(struct amdgpu_device *adev)struct drm_connector_list_iter iter;int r; +drm_kms_helper_poll_disable (dev); +/* turn off display hw */ drm_modeset_lock_all (dev);drm_connector_list_iter_begin (dev, &iter);@@ -1694,6 +1696,8 @@ int amdgpu_display_resume_helper(struct amdgpu_device *adev)drm_modeset_unlock_all (dev); +drm_kms_helper_poll_enable (dev); +return 0 ; } --2.25.1