* [PATCH] drm/amdgpu: atombios stuck executing during S3 stress test
@ 2016-10-19 8:25 jimqu
[not found] ` <1476865529-8924-1-git-send-email-Jim.Qu-5C7GfCeVMHo@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: jimqu @ 2016-10-19 8:25 UTC (permalink / raw)
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: jimqu
Sometimes, atombios may be stucked when resume back. Duo to PCIE has
set to D3cold, the ACC of GFX adapter is power-down. it should re-init
the scratch registers. with the change, test is pass more than 80 cycles
on Fiji.
Change-Id: I9cf40c475c4a5a31216949d50cc5e30b74dc21c4
Signed-off-by: JimQu <Jim.Qu@amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index e82c487..bfe9a5c 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -2098,6 +2098,7 @@ int amdgpu_device_resume(struct drm_device *dev, bool resume, bool fbcon)
console_unlock();
return r;
}
+ amdgpu_atombios_scratch_regs_init(adev);
}
/* post card */
--
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] 3+ messages in thread
* Re: [PATCH] drm/amdgpu: atombios stuck executing during S3 stress test
[not found] ` <1476865529-8924-1-git-send-email-Jim.Qu-5C7GfCeVMHo@public.gmane.org>
@ 2016-10-19 18:46 ` Alex Deucher
[not found] ` <CADnq5_MOypPU09YUtH1xanHCTyd7gODV4UUWerHzaX13iwCq2A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Alex Deucher @ 2016-10-19 18:46 UTC (permalink / raw)
To: jimqu; +Cc: amd-gfx list
[-- Attachment #1: Type: text/plain, Size: 1382 bytes --]
On Wed, Oct 19, 2016 at 4:25 AM, jimqu <Jim.Qu-5C7GfCeVMHo@public.gmane.org> wrote:
> Sometimes, atombios may be stucked when resume back. Duo to PCIE has
> set to D3cold, the ACC of GFX adapter is power-down. it should re-init
> the scratch registers. with the change, test is pass more than 80 cycles
> on Fiji.
>
> Change-Id: I9cf40c475c4a5a31216949d50cc5e30b74dc21c4
> Signed-off-by: JimQu <Jim.Qu-5C7GfCeVMHo@public.gmane.org>
I think we probably want to save/restore these, although this
shouldn't hurt. How about this patch?
Alex
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index e82c487..bfe9a5c 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -2098,6 +2098,7 @@ int amdgpu_device_resume(struct drm_device *dev, bool resume, bool fbcon)
> console_unlock();
> return r;
> }
> + amdgpu_atombios_scratch_regs_init(adev);
> }
>
> /* post card */
> --
> 1.9.1
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[-- Attachment #2: 0001-drm-amdgpu-move-atom-scratch-register-save-restore-t.patch --]
[-- Type: text/x-patch, Size: 4935 bytes --]
From bf70713edda60da5713e4acd8f1615144e02abe2 Mon Sep 17 00:00:00 2001
From: Alex Deucher <alexander.deucher@amd.com>
Date: Wed, 19 Oct 2016 14:40:58 -0400
Subject: [PATCH] drm/amdgpu: move atom scratch register save/restore to common
code
We need this for more than just DCE. Move it out of the DCE modules
and into the device code. This way we can be sure the scratch registers
are initialized properly before we run asic_init which happens before
DCE IPs are restored.
Fixes atombios hangs in asic_init.
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 5 ++++-
drivers/gpu/drm/amd/amdgpu/dce_v10_0.c | 6 ------
drivers/gpu/drm/amd/amdgpu/dce_v11_0.c | 6 ------
drivers/gpu/drm/amd/amdgpu/dce_v6_0.c | 6 ------
drivers/gpu/drm/amd/amdgpu/dce_v8_0.c | 6 ------
5 files changed, 4 insertions(+), 25 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index eb1b9e39..b7b6542 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -2004,6 +2004,7 @@ int amdgpu_device_suspend(struct drm_device *dev, bool suspend, bool fbcon)
*/
amdgpu_bo_evict_vram(adev);
+ amdgpu_atombios_scratch_regs_save(adev);
pci_save_state(dev->pdev);
if (suspend) {
/* Shut down the device */
@@ -2055,6 +2056,7 @@ int amdgpu_device_resume(struct drm_device *dev, bool resume, bool fbcon)
return r;
}
}
+ amdgpu_atombios_scratch_regs_restore(adev);
/* post card */
if (!amdgpu_card_posted(adev) || !resume) {
@@ -2322,8 +2324,9 @@ retry:
amdgpu_display_stop_mc_access(adev, &save);
amdgpu_wait_for_idle(adev, AMD_IP_BLOCK_TYPE_GMC);
}
-
+ amdgpu_atombios_scratch_regs_save(adev);
r = amdgpu_asic_reset(adev);
+ amdgpu_atombios_scratch_regs_restore(adev);
/* post card */
amdgpu_atom_asic_init(adev->mode_info.atom_context);
diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c
index e5d0edf..0c01852 100644
--- a/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c
@@ -3067,10 +3067,6 @@ static int dce_v10_0_hw_fini(void *handle)
static int dce_v10_0_suspend(void *handle)
{
- struct amdgpu_device *adev = (struct amdgpu_device *)handle;
-
- amdgpu_atombios_scratch_regs_save(adev);
-
return dce_v10_0_hw_fini(handle);
}
@@ -3081,8 +3077,6 @@ static int dce_v10_0_resume(void *handle)
ret = dce_v10_0_hw_init(handle);
- amdgpu_atombios_scratch_regs_restore(adev);
-
/* turn on the BL */
if (adev->mode_info.bl_encoder) {
u8 bl_level = amdgpu_display_backlight_get_level(adev,
diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c
index 9719b2b..2946674 100644
--- a/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c
@@ -3131,10 +3131,6 @@ static int dce_v11_0_hw_fini(void *handle)
static int dce_v11_0_suspend(void *handle)
{
- struct amdgpu_device *adev = (struct amdgpu_device *)handle;
-
- amdgpu_atombios_scratch_regs_save(adev);
-
return dce_v11_0_hw_fini(handle);
}
@@ -3145,8 +3141,6 @@ static int dce_v11_0_resume(void *handle)
ret = dce_v11_0_hw_init(handle);
- amdgpu_atombios_scratch_regs_restore(adev);
-
/* turn on the BL */
if (adev->mode_info.bl_encoder) {
u8 bl_level = amdgpu_display_backlight_get_level(adev,
diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c
index 44547f9..5742333 100644
--- a/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c
@@ -2403,10 +2403,6 @@ static int dce_v6_0_hw_fini(void *handle)
static int dce_v6_0_suspend(void *handle)
{
- struct amdgpu_device *adev = (struct amdgpu_device *)handle;
-
- amdgpu_atombios_scratch_regs_save(adev);
-
return dce_v6_0_hw_fini(handle);
}
@@ -2417,8 +2413,6 @@ static int dce_v6_0_resume(void *handle)
ret = dce_v6_0_hw_init(handle);
- amdgpu_atombios_scratch_regs_restore(adev);
-
/* turn on the BL */
if (adev->mode_info.bl_encoder) {
u8 bl_level = amdgpu_display_backlight_get_level(adev,
diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c
index 16a2f1f..3a2d695 100644
--- a/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c
@@ -2912,10 +2912,6 @@ static int dce_v8_0_hw_fini(void *handle)
static int dce_v8_0_suspend(void *handle)
{
- struct amdgpu_device *adev = (struct amdgpu_device *)handle;
-
- amdgpu_atombios_scratch_regs_save(adev);
-
return dce_v8_0_hw_fini(handle);
}
@@ -2926,8 +2922,6 @@ static int dce_v8_0_resume(void *handle)
ret = dce_v8_0_hw_init(handle);
- amdgpu_atombios_scratch_regs_restore(adev);
-
/* turn on the BL */
if (adev->mode_info.bl_encoder) {
u8 bl_level = amdgpu_display_backlight_get_level(adev,
--
2.5.5
[-- Attachment #3: 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] 3+ messages in thread
* 答复: [PATCH] drm/amdgpu: atombios stuck executing during S3 stress test
[not found] ` <CADnq5_MOypPU09YUtH1xanHCTyd7gODV4UUWerHzaX13iwCq2A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2016-10-20 4:40 ` Qu, Jim
0 siblings, 0 replies; 3+ messages in thread
From: Qu, Jim @ 2016-10-20 4:40 UTC (permalink / raw)
To: Alex Deucher; +Cc: amd-gfx list
Hi Alex:
Yes, feel free to add my RB, Reviewed-by: JimQu <Jim.Qu@amd.com>
Thanks
JimQu
________________________________________
发件人: Alex Deucher <alexdeucher@gmail.com>
发送时间: 2016年10月20日 2:46
收件人: Qu, Jim
抄送: amd-gfx list
主题: Re: [PATCH] drm/amdgpu: atombios stuck executing during S3 stress test
On Wed, Oct 19, 2016 at 4:25 AM, jimqu <Jim.Qu@amd.com> wrote:
> Sometimes, atombios may be stucked when resume back. Duo to PCIE has
> set to D3cold, the ACC of GFX adapter is power-down. it should re-init
> the scratch registers. with the change, test is pass more than 80 cycles
> on Fiji.
>
> Change-Id: I9cf40c475c4a5a31216949d50cc5e30b74dc21c4
> Signed-off-by: JimQu <Jim.Qu@amd.com>
I think we probably want to save/restore these, although this
shouldn't hurt. How about this patch?
Alex
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index e82c487..bfe9a5c 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -2098,6 +2098,7 @@ int amdgpu_device_resume(struct drm_device *dev, bool resume, bool fbcon)
> console_unlock();
> return r;
> }
> + amdgpu_atombios_scratch_regs_init(adev);
> }
>
> /* post card */
> --
> 1.9.1
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-10-20 4:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-19 8:25 [PATCH] drm/amdgpu: atombios stuck executing during S3 stress test jimqu
[not found] ` <1476865529-8924-1-git-send-email-Jim.Qu-5C7GfCeVMHo@public.gmane.org>
2016-10-19 18:46 ` Alex Deucher
[not found] ` <CADnq5_MOypPU09YUtH1xanHCTyd7gODV4UUWerHzaX13iwCq2A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-10-20 4:40 ` 答复: " Qu, Jim
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox