drm/amdgpu: fix solid screen and hard hang when 2k + 4k display connected with DP
Subsystems (2)
PATCH 1/1 drm/amdgpu: fix solid screen and hard hang when 2k + 4k display connected with DP
--- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +1 -1
@@ -130,7 +130,7 @@ psp_cmd_submit_buf(struct psp_context *psp, ret =psp_cmd_submit (psp, ucode, cmd_buf_mc_addr, fence_mc_addr, index); -while (*((unsigned int *)psp->fence_buf) != index) { +while (*((unsigned int *)psp->fence_buf) < index) {msleep (1 ); }
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 1498460629-9481-1-git-send-email-ray.huang-5C7GfCeVMHo@public.gmane.org
Am 26.06.2017 um 09:03 schrieb Huang Rui:
Quoted 11 lines
Signed-off-by Huang Rui <[email protected]>Cc Xiaojie Yuan <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +0
-0
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c psp_cmd_submit_buf(struct psp_context *psp, · line 133
Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +1
-1@@ -130,7 +130,7 @@ psp_cmd_submit_buf(struct psp_context *psp, ret =psp_cmd_submit (psp, ucode, cmd_buf_mc_addr, fence_mc_addr, index); -while (*((unsigned int *)psp->fence_buf) != index) { +while (*((unsigned int *)psp->fence_buf) < index) {
That is still horrible incorrect. At bare minimum you need to use the READ_ONCE() macro here.
But it would be even better to completely drop this and use the fence implementation in amdgpu_fence.c as well.
Christian.
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c psp_cmd_submit_buf(struct psp_context *psp, · line 136
Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +0
-0msleep (1 ); }
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 24e624a1-3f79-752a-ef12-adf5c1b407a2-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org
Quoted 16 lines · Christian König
Am 26.06.2017 um 09:03 schrieb Huang Rui:
drivers/gpu/drm/amd/
Quoted 7 lines
Signed-off-by Huang Rui <[email protected]>Cc Xiaojie Yuan <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/ renamed from drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +0
-0
amdgpu/amdgpu_psp.cQuoted 7 lines
index 5bed483..60d0455 100644
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +0
-0@@ -130,7 +130,7 @@ psp_cmd_submit_buf(struct psp_context *psp, ret =psp_cmd_submit (psp, ucode, cmd_buf_mc_addr, fence_mc_addr, index);
Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c psp_cmd_submit_buf(struct psp_context *psp, · line 133
Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +1
-1-while (*((unsigned int *)psp->fence_buf) != index) { +while (*((unsigned int *)psp->fence_buf) < index) {That is still horrible incorrect. At bare minimum you need to use the
READ_ONCE()macro here.
So, READ_ONCE(*((unsigned int *)psp->fence_buf)) < index. Do you mean the complier might cause to read the previous fence buffer value if we don't add READ_ONCE?
Quoted 3 lines
But it would be even better to completely drop this and use the fence implementation in
amdgpu_fence.cas well.
I understand, I will refactor it after S3 stress completed.
Thanks,
Ray
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Am 26.06.2017 um 12:53 schrieb Huang Rui:
Quoted 17 lines · Christian König
Quoted 16 lines
Am 26.06.2017 um 09:03 schrieb Huang Rui:
drivers/gpu/drm/amd/
Quoted 7 lines
Signed-off-by Huang Rui <[email protected]>Cc Xiaojie Yuan <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/ renamed from drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +0
-0
amdgpu/amdgpu_psp.cQuoted 7 lines
index 5bed483..60d0455 100644
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +0
-0@@ -130,7 +130,7 @@ psp_cmd_submit_buf(struct psp_context *psp, ret =psp_cmd_submit (psp, ucode, cmd_buf_mc_addr, fence_mc_addr, index);
Quoted 8 lines
Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c psp_cmd_submit_buf(struct psp_context *psp, · line 133
Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +1
-1-while (*((unsigned int *)psp->fence_buf) != index) { +while (*((unsigned int *)psp->fence_buf) < index) {That is still horrible incorrect. At bare minimum you need to use the
READ_ONCE()macro here.So,
READ_ONCE(*((unsigned int *)psp->fence_buf))< index. Do you mean the complier might cause to read the previous fence buffer value if we don't addREAD_ONCE?
Yes, exactly. I would guess that this only works by coincident because the msleep() is causing a barrier here.
Christian.
Quoted 8 lines
Quoted 4 lines
But it would be even better to completely drop this and use the fence implementation in
amdgpu_fence.cas well.I understand, I will refactor it after S3 stress completed.
Thanks,
Ray
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx