<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<div>David Mao reported amd_sched_process doesn't balance with cs_ioctl, you should see that thread.<br>
<br>
Regards,<br>
David Zhou<br>
<br>
Sent from my Huawei Mobile<br>
<br>
-------- 原始邮件 --------<br>
主题:Re: [PATCH] drm/amdgpu: fix losting fence signal<br>
发件人:Christian K鰊ig <br>
收件人:"Zhou, David(ChunMing)" ,amd-gfx@lists.freedesktop.org<br>
抄送:"Mao, David" <br>
<br>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">Am 22.06.2016 um 08:58 schrieb Chunming Zhou:<br>
> Change-Id: Ibfb7e8af796cc178dfb40d8aaabda472de3c5eda<br>
> Signed-off-by: Chunming Zhou <David1.Zhou@amd.com><br>
<br>
NAK, this could lead to a situation where we try to signal a fence twice.<br>
<br>
Why do you think that we would loose fences otherwise?<br>
<br>
Regards,<br>
Christian.<br>
<br>
> ---<br>
> drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 7 ++++---<br>
> 1 file changed, 4 insertions(+), 3 deletions(-)<br>
><br>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c<br>
> index 17bd5af..6a69336 100644<br>
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c<br>
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c<br>
> @@ -192,9 +192,10 @@ static void amdgpu_fence_schedule_fallback(struct amdgpu_ring *ring)<br>
> void amdgpu_fence_process(struct amdgpu_ring *ring)<br>
> {<br>
> struct amdgpu_fence_driver *drv = &ring->fence_drv;<br>
> - uint32_t seq, last_seq;<br>
> + uint32_t seq, last_seq, old_seq;<br>
> int r;<br>
> <br>
> + old_seq = atomic_read(&ring->fence_drv.last_seq);<br>
> do {<br>
> last_seq = atomic_read(&ring->fence_drv.last_seq);<br>
> seq = amdgpu_fence_read(ring);<br>
> @@ -204,10 +205,10 @@ void amdgpu_fence_process(struct amdgpu_ring *ring)<br>
> if (seq != ring->fence_drv.sync_seq)<br>
> amdgpu_fence_schedule_fallback(ring);<br>
> <br>
> - while (last_seq != seq) {<br>
> + while (old_seq != seq) {<br>
> struct fence *fence, **ptr;<br>
> <br>
> - ptr = &drv->fences[++last_seq & drv->num_fences_mask];<br>
> + ptr = &drv->fences[++old_seq & drv->num_fences_mask];<br>
> <br>
> /* There is always exactly one thread signaling this fence slot */<br>
> fence = rcu_dereference_protected(*ptr, 1);<br>
<br>
</div>
</span></font>
</body>
</html>