All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: Cancel gfx off delay work when driver fini/suspend
@ 2018-08-09  7:31 Rex Zhu
       [not found] ` <1533799883-26407-1-git-send-email-Rex.Zhu-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Rex Zhu @ 2018-08-09  7:31 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Rex Zhu

there may be gfx off delay work pending when suspend/driver
unload, need to cancel them first.

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 1d933db..383f8eb 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -1829,6 +1829,7 @@ static int amdgpu_device_ip_fini(struct amdgpu_device *adev)
 				return r;
 			}
 			amdgpu_gfx_off_ctrl(adev, false);
+			cancel_delayed_work_sync(&adev->gfx.gfx_off_delay_work);
 			r = adev->ip_blocks[i].version->funcs->hw_fini((void *)adev);
 			/* XXX handle errors */
 			if (r) {
@@ -2012,6 +2013,7 @@ static int amdgpu_device_ip_suspend_phase2(struct amdgpu_device *adev)
 
 	/* call smu to disable gfx off feature first when suspend */
 	amdgpu_gfx_off_ctrl(adev, false);
+	cancel_delayed_work_sync(&adev->gfx.gfx_off_delay_work);
 
 	for (i = adev->num_ip_blocks - 1; i >= 0; i--) {
 		if (!adev->ip_blocks[i].status.valid)
-- 
1.9.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] drm/amdgpu: Cancel gfx off delay work when driver fini/suspend
       [not found] ` <1533799883-26407-1-git-send-email-Rex.Zhu-5C7GfCeVMHo@public.gmane.org>
@ 2018-08-09 12:34   ` Deucher, Alexander
  0 siblings, 0 replies; 2+ messages in thread
From: Deucher, Alexander @ 2018-08-09 12:34 UTC (permalink / raw)
  To: Zhu, Rex, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW


[-- Attachment #1.1: Type: text/plain, Size: 2009 bytes --]

Reviewed-by: Alex Deucher <alexander.deucher-5C7GfCeVMHo@public.gmane.org>


________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Rex Zhu <Rex.Zhu-5C7GfCeVMHo@public.gmane.org>
Sent: Thursday, August 9, 2018 3:31 AM
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Cc: Zhu, Rex
Subject: [PATCH] drm/amdgpu: Cancel gfx off delay work when driver fini/suspend

there may be gfx off delay work pending when suspend/driver
unload, need to cancel them first.

Signed-off-by: Rex Zhu <Rex.Zhu-5C7GfCeVMHo@public.gmane.org>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 1d933db..383f8eb 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -1829,6 +1829,7 @@ static int amdgpu_device_ip_fini(struct amdgpu_device *adev)
                                 return r;
                         }
                         amdgpu_gfx_off_ctrl(adev, false);
+                       cancel_delayed_work_sync(&adev->gfx.gfx_off_delay_work);
                         r = adev->ip_blocks[i].version->funcs->hw_fini((void *)adev);
                         /* XXX handle errors */
                         if (r) {
@@ -2012,6 +2013,7 @@ static int amdgpu_device_ip_suspend_phase2(struct amdgpu_device *adev)

         /* call smu to disable gfx off feature first when suspend */
         amdgpu_gfx_off_ctrl(adev, false);
+       cancel_delayed_work_sync(&adev->gfx.gfx_off_delay_work);

         for (i = adev->num_ip_blocks - 1; i >= 0; i--) {
                 if (!adev->ip_blocks[i].status.valid)
--
1.9.1

_______________________________________________
amd-gfx mailing list
amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

[-- Attachment #1.2: Type: text/html, Size: 4480 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-08-09 12:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-09  7:31 [PATCH] drm/amdgpu: Cancel gfx off delay work when driver fini/suspend Rex Zhu
     [not found] ` <1533799883-26407-1-git-send-email-Rex.Zhu-5C7GfCeVMHo@public.gmane.org>
2018-08-09 12:34   ` Deucher, Alexander

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.