[SRU] [D/E] [PATCH 0/1] Fix S3 screen freeze on AMD Stoney Ridge

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[SRU] [D/E] [PATCH 0/1] Fix S3 screen freeze on AMD Stoney Ridge

Kai-Heng Feng
BugLink: https://bugs.launchpad.net/bugs/1833617

[Impact]
Screen freeze after S3 on AMD Stoney Ridge.

[Fix]
Pin the VRAM so it won't contain garbage data after S3.

[Test]
After applying this patch I can confirm the issue is gone on Dell
Inspiron 3180, a Stoney Ridge laptop.

[Regression Potential]
Low. This patch only touched a small subset of amdgpu.

Likun Gao (1):
  drm/amdgpu: pin the csb buffer on hw init for gfx v8

 drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 40 +++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)

--
2.17.1


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[PATCH 1/1] drm/amdgpu: pin the csb buffer on hw init for gfx v8

Kai-Heng Feng
From: Likun Gao <[hidden email]>

BugLink: https://bugs.launchpad.net/bugs/1833617

Without this pin, the csb buffer will be filled with inconsistent
data after S3 resume. And that will causes gfx hang on gfxoff
exit since this csb will be executed then.

Signed-off-by: Likun Gao <[hidden email]>
Tested-by: Paul Gover <[hidden email]>
Reviewed-by: Feifei Xu <[hidden email]>
Reviewed-by: Xiaojie Yuan <[hidden email]>
Signed-off-by: Alex Deucher <[hidden email]>
(cherry picked from commit 72cda9bb5e219aea0f2f62f56ae05198c59022a7)
Signed-off-by: Kai-Heng Feng <[hidden email]>
---
 drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 40 +++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
index 57cb3a51bda7..f558758f2dc1 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
@@ -1317,6 +1317,39 @@ static int gfx_v8_0_rlc_init(struct amdgpu_device *adev)
  return 0;
 }
 
+static int gfx_v8_0_csb_vram_pin(struct amdgpu_device *adev)
+{
+ int r;
+
+ r = amdgpu_bo_reserve(adev->gfx.rlc.clear_state_obj, false);
+ if (unlikely(r != 0))
+ return r;
+
+ r = amdgpu_bo_pin(adev->gfx.rlc.clear_state_obj,
+ AMDGPU_GEM_DOMAIN_VRAM);
+ if (!r)
+ adev->gfx.rlc.clear_state_gpu_addr =
+ amdgpu_bo_gpu_offset(adev->gfx.rlc.clear_state_obj);
+
+ amdgpu_bo_unreserve(adev->gfx.rlc.clear_state_obj);
+
+ return r;
+}
+
+static void gfx_v8_0_csb_vram_unpin(struct amdgpu_device *adev)
+{
+ int r;
+
+ if (!adev->gfx.rlc.clear_state_obj)
+ return;
+
+ r = amdgpu_bo_reserve(adev->gfx.rlc.clear_state_obj, true);
+ if (likely(r == 0)) {
+ amdgpu_bo_unpin(adev->gfx.rlc.clear_state_obj);
+ amdgpu_bo_unreserve(adev->gfx.rlc.clear_state_obj);
+ }
+}
+
 static void gfx_v8_0_mec_fini(struct amdgpu_device *adev)
 {
  amdgpu_bo_free_kernel(&adev->gfx.mec.hpd_eop_obj, NULL, NULL);
@@ -4776,6 +4809,10 @@ static int gfx_v8_0_hw_init(void *handle)
  gfx_v8_0_init_golden_registers(adev);
  gfx_v8_0_constants_init(adev);
 
+ r = gfx_v8_0_csb_vram_pin(adev);
+ if (r)
+ return r;
+
  r = adev->gfx.rlc.funcs->resume(adev);
  if (r)
  return r;
@@ -4892,6 +4929,9 @@ static int gfx_v8_0_hw_fini(void *handle)
  else
  pr_err("rlc is busy, skip halt rlc\n");
  amdgpu_gfx_rlc_exit_safe_mode(adev);
+
+ gfx_v8_0_csb_vram_unpin(adev);
+
  return 0;
 }
 
--
2.17.1


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

ACK / APPLIED[E]: [SRU] [D/E] [PATCH 0/1] Fix S3 screen freeze on AMD Stoney Ridge

Seth Forshee
In reply to this post by Kai-Heng Feng
On Mon, Sep 02, 2019 at 04:22:40PM +0800, Kai-Heng Feng wrote:

> BugLink: https://bugs.launchpad.net/bugs/1833617
>
> [Impact]
> Screen freeze after S3 on AMD Stoney Ridge.
>
> [Fix]
> Pin the VRAM so it won't contain garbage data after S3.
>
> [Test]
> After applying this patch I can confirm the issue is gone on Dell
> Inspiron 3180, a Stoney Ridge laptop.
>
> [Regression Potential]
> Low. This patch only touched a small subset of amdgpu.

Upstream cherry pick, positive testing.

Acked-by: Seth Forshee <[hidden email]>

Applied to eoan/master-next, thanks!

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team