* [PATCH] drm/amdgpu: lock and unlock console only for amdgpu_fbdev_set_suspend [V2]
@ 2018-07-18 10:24 Shirish S
[not found] ` <1531909474-9661-1-git-send-email-shirish.s-5C7GfCeVMHo@public.gmane.org>
0 siblings, 1 reply; 5+ messages in thread
From: Shirish S @ 2018-07-18 10:24 UTC (permalink / raw)
To: alexander.deucher-5C7GfCeVMHo, christian.koenig-5C7GfCeVMHo,
michel-otUistvHUpPR7s880joybQ
Cc: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Shirish S
[Why]
While the console_lock is held, console output will be buffered, till
its unlocked it wont be emitted, hence its ideal to unlock sooner to enable
debugging/detecting/fixing of any issue in the remaining sequence of events
in resume path.
[How]
This patch restructures the console_lock, console_unlock around
amdgpu_fbdev_set_suspend() and moves this new block appropriately.
V2: Kept amdgpu_fbdev_set_suspend after pci_set_power_state
Signed-off-by: Shirish S <shirish.s@amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 13 +++----------
1 file changed, 3 insertions(+), 10 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 709e4a3..b0fe727 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -2720,9 +2720,6 @@ int amdgpu_device_resume(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);
@@ -2746,7 +2743,6 @@ int amdgpu_device_resume(struct drm_device *dev, bool resume, bool fbcon)
amdgpu_fence_driver_resume(adev);
-
r = amdgpu_device_ip_late_init(adev);
if (r)
goto unlock;
@@ -2784,6 +2780,9 @@ int amdgpu_device_resume(struct drm_device *dev, bool resume, bool fbcon)
}
drm_modeset_unlock_all(dev);
}
+ console_lock();
+ amdgpu_fbdev_set_suspend(adev, 0);
+ console_unlock();
}
drm_kms_helper_poll_enable(dev);
@@ -2808,13 +2807,7 @@ int amdgpu_device_resume(struct drm_device *dev, bool resume, bool fbcon)
dev->dev->power.disable_depth--;
#endif
- if (fbcon)
- amdgpu_fbdev_set_suspend(adev, 0);
-
unlock:
- if (fbcon)
- console_unlock();
-
return r;
}
--
2.7.4
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] drm/amdgpu: lock and unlock console only for amdgpu_fbdev_set_suspend [V2]
[not found] ` <1531909474-9661-1-git-send-email-shirish.s-5C7GfCeVMHo@public.gmane.org>
@ 2018-07-19 9:20 ` Michel Dänzer
[not found] ` <ad4b3eec-d4d8-ceb5-dd11-e1562a82cc61-otUistvHUpPR7s880joybQ@public.gmane.org>
0 siblings, 1 reply; 5+ messages in thread
From: Michel Dänzer @ 2018-07-19 9:20 UTC (permalink / raw)
To: Shirish S, alexander.deucher-5C7GfCeVMHo, christian.koenig-5C7GfCeVMHo
Cc: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
On 2018-07-18 12:24 PM, Shirish S wrote:
> [Why]
> While the console_lock is held, console output will be buffered, till
> its unlocked it wont be emitted, hence its ideal to unlock sooner to enable
> debugging/detecting/fixing of any issue in the remaining sequence of events
> in resume path.
Maybe this could be clarified that the concern is about consoles other
than fbcon on this device, e.g. a serial console.
> @@ -2746,7 +2743,6 @@ int amdgpu_device_resume(struct drm_device *dev, bool resume, bool fbcon)
>
> amdgpu_fence_driver_resume(adev);
>
> -
> r = amdgpu_device_ip_late_init(adev);
> if (r)
> goto unlock;
Drop this hunk.
With the above fixed,
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Possible follow-up work:
* Move the console_(un)lock calls into amdgpu_fbdev_set_suspend, or
maybe use drm_fb_helper_set_suspend_unlocked instead of locking ourselves
* Move the amdgpu_fbdev_set_suspend call in amdgpu_device_suspend
further up, at least before the pci_set_power_state call.
--
Earthling Michel Dänzer | http://www.amd.com
Libre software enthusiast | Mesa and X developer
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] drm/amdgpu: lock and unlock console only for amdgpu_fbdev_set_suspend [V2]
[not found] ` <ad4b3eec-d4d8-ceb5-dd11-e1562a82cc61-otUistvHUpPR7s880joybQ@public.gmane.org>
@ 2018-07-20 7:34 ` Michel Dänzer
[not found] ` <2362eda1-1e47-fd99-fdbd-c02c208d18bf-otUistvHUpPR7s880joybQ@public.gmane.org>
0 siblings, 1 reply; 5+ messages in thread
From: Michel Dänzer @ 2018-07-20 7:34 UTC (permalink / raw)
To: Shirish S; +Cc: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
On 2018-07-19 11:20 AM, Michel Dänzer wrote:
>
> Possible follow-up work:
>
> * Move the console_(un)lock calls into amdgpu_fbdev_set_suspend, or
> maybe use drm_fb_helper_set_suspend_unlocked instead of locking ourselves
>
> * Move the amdgpu_fbdev_set_suspend call in amdgpu_device_suspend
> further up, at least before the pci_set_power_state call.
Shirish, would you like to look into these?
--
Earthling Michel Dänzer | http://www.amd.com
Libre software enthusiast | Mesa and X developer
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [PATCH] drm/amdgpu: lock and unlock console only for amdgpu_fbdev_set_suspend [V2]
[not found] ` <2362eda1-1e47-fd99-fdbd-c02c208d18bf-otUistvHUpPR7s880joybQ@public.gmane.org>
@ 2018-07-20 7:58 ` S, Shirish
[not found] ` <BLUPR12MB0452C43DC65A9023EF3231B2F2510-7LeqcoF/hwohIaQXubWUmgdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
0 siblings, 1 reply; 5+ messages in thread
From: S, Shirish @ 2018-07-20 7:58 UTC (permalink / raw)
To: Michel Dänzer; +Cc: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
Sure Michel, but not immediately.
Is that fine?
Regards,
Shirish S
-----Original Message-----
From: Michel Dänzer [mailto:michel@daenzer.net]
Sent: Friday, July 20, 2018 1:04 PM
To: S, Shirish <Shirish.S@amd.com>
Cc: amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/amdgpu: lock and unlock console only for amdgpu_fbdev_set_suspend [V2]
On 2018-07-19 11:20 AM, Michel Dänzer wrote:
>
> Possible follow-up work:
>
> * Move the console_(un)lock calls into amdgpu_fbdev_set_suspend, or
> maybe use drm_fb_helper_set_suspend_unlocked instead of locking
> ourselves
>
> * Move the amdgpu_fbdev_set_suspend call in amdgpu_device_suspend
> further up, at least before the pci_set_power_state call.
Shirish, would you like to look into these?
--
Earthling Michel Dänzer | http://www.amd.com
Libre software enthusiast | Mesa and X developer
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] drm/amdgpu: lock and unlock console only for amdgpu_fbdev_set_suspend [V2]
[not found] ` <BLUPR12MB0452C43DC65A9023EF3231B2F2510-7LeqcoF/hwohIaQXubWUmgdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
@ 2018-07-20 8:20 ` Michel Dänzer
0 siblings, 0 replies; 5+ messages in thread
From: Michel Dänzer @ 2018-07-20 8:20 UTC (permalink / raw)
To: S, Shirish; +Cc: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
On 2018-07-20 09:58 AM, S, Shirish wrote:
> Sure Michel, but not immediately.
> Is that fine?
Sure, thanks.
--
Earthling Michel Dänzer | http://www.amd.com
Libre software enthusiast | Mesa and X developer
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-07-20 8:20 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-18 10:24 [PATCH] drm/amdgpu: lock and unlock console only for amdgpu_fbdev_set_suspend [V2] Shirish S
[not found] ` <1531909474-9661-1-git-send-email-shirish.s-5C7GfCeVMHo@public.gmane.org>
2018-07-19 9:20 ` Michel Dänzer
[not found] ` <ad4b3eec-d4d8-ceb5-dd11-e1562a82cc61-otUistvHUpPR7s880joybQ@public.gmane.org>
2018-07-20 7:34 ` Michel Dänzer
[not found] ` <2362eda1-1e47-fd99-fdbd-c02c208d18bf-otUistvHUpPR7s880joybQ@public.gmane.org>
2018-07-20 7:58 ` S, Shirish
[not found] ` <BLUPR12MB0452C43DC65A9023EF3231B2F2510-7LeqcoF/hwohIaQXubWUmgdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2018-07-20 8:20 ` Michel Dänzer
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.