* [PATCH] drm/radeon: do not left queue acquired if timeout happens in kgd_hqd_destroy()
@ 2015-01-03 23:31 Alexey Khoroshilov
2015-01-04 19:58 ` Oded Gabbay
0 siblings, 1 reply; 2+ messages in thread
From: Alexey Khoroshilov @ 2015-01-03 23:31 UTC (permalink / raw)
To: Oded Gabbay
Cc: Alexey Khoroshilov, Alex Deucher, Christian König, dri-devel,
linux-kernel, ldv-project
If timeout happens, kgd_hqd_destroy() just returns -ETIME leaving queue acquired.
It may cause a deadlock, so the patch proposes to release queue before return.
Found by Linux Driver Verification project (linuxtesting.org).
Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
---
drivers/gpu/drm/radeon/radeon_kfd.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/radeon/radeon_kfd.c b/drivers/gpu/drm/radeon/radeon_kfd.c
index 242fd8b1b221..335e29dbab05 100644
--- a/drivers/gpu/drm/radeon/radeon_kfd.c
+++ b/drivers/gpu/drm/radeon/radeon_kfd.c
@@ -556,6 +556,7 @@ static int kgd_hqd_destroy(struct kgd_dev *kgd, uint32_t reset_type,
if (timeout == 0) {
pr_err("kfd: cp queue preemption time out (%dms)\n",
temp);
+ release_queue(kgd);
return -ETIME;
}
msleep(20);
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] drm/radeon: do not left queue acquired if timeout happens in kgd_hqd_destroy()
2015-01-03 23:31 [PATCH] drm/radeon: do not left queue acquired if timeout happens in kgd_hqd_destroy() Alexey Khoroshilov
@ 2015-01-04 19:58 ` Oded Gabbay
0 siblings, 0 replies; 2+ messages in thread
From: Oded Gabbay @ 2015-01-04 19:58 UTC (permalink / raw)
To: Alexey Khoroshilov
Cc: Alex Deucher, Christian König, dri-devel, linux-kernel,
ldv-project
On 01/04/2015 01:31 AM, Alexey Khoroshilov wrote:
> If timeout happens, kgd_hqd_destroy() just returns -ETIME leaving queue acquired.
> It may cause a deadlock, so the patch proposes to release queue before return.
>
> Found by Linux Driver Verification project (linuxtesting.org).
>
> Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
> ---
> drivers/gpu/drm/radeon/radeon_kfd.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_kfd.c b/drivers/gpu/drm/radeon/radeon_kfd.c
> index 242fd8b1b221..335e29dbab05 100644
> --- a/drivers/gpu/drm/radeon/radeon_kfd.c
> +++ b/drivers/gpu/drm/radeon/radeon_kfd.c
> @@ -556,6 +556,7 @@ static int kgd_hqd_destroy(struct kgd_dev *kgd, uint32_t reset_type,
> if (timeout == 0) {
> pr_err("kfd: cp queue preemption time out (%dms)\n",
> temp);
> + release_queue(kgd);
> return -ETIME;
> }
> msleep(20);
>
Thanks for catching that!
Applied to my fixes tree.
Oded
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-01-04 19:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-03 23:31 [PATCH] drm/radeon: do not left queue acquired if timeout happens in kgd_hqd_destroy() Alexey Khoroshilov
2015-01-04 19:58 ` Oded Gabbay
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).