All of lore.kernel.org
 help / color / mirror / Atom feed
* Patch "drm/amdgpu: hold reference to fences in amdgpu_sa_bo_new (v2)" has been added to the 4.4-stable tree
@ 2016-03-01 19:49 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2016-03-01 19:49 UTC (permalink / raw)
  To: nicolai.haehnle, alexander.deucher, christian.koenig, gregkh
  Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    drm/amdgpu: hold reference to fences in amdgpu_sa_bo_new (v2)

to the 4.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     drm-amdgpu-hold-reference-to-fences-in-amdgpu_sa_bo_new-v2.patch
and it can be found in the queue-4.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From a8d81b36267366603771431747438d18f32ae2d5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nicolai=20H=C3=A4hnle?= <nicolai.haehnle@amd.com>
Date: Fri, 5 Feb 2016 10:59:43 -0500
Subject: drm/amdgpu: hold reference to fences in amdgpu_sa_bo_new (v2)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

From: Nicolai Hähnle <nicolai.haehnle@amd.com>

commit a8d81b36267366603771431747438d18f32ae2d5 upstream.

An arbitrary amount of time can pass between spin_unlock and
fence_wait_any_timeout, so we need to ensure that nobody frees the
fences from under us.

A stress test (rapidly starting and killing hundreds of glxgears
instances) ran into a deadlock in fence_wait_any_timeout after
about an hour, and this race condition appears to be a plausible
cause.

v2: agd: rebase on upstream

Signed-off-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_sa.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_sa.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_sa.c
@@ -354,12 +354,15 @@ int amdgpu_sa_bo_new(struct amdgpu_sa_ma
 
 		for (i = 0, count = 0; i < AMDGPU_MAX_RINGS; ++i)
 			if (fences[i])
-				fences[count++] = fences[i];
+				fences[count++] = fence_get(fences[i]);
 
 		if (count) {
 			spin_unlock(&sa_manager->wq.lock);
 			t = fence_wait_any_timeout(fences, count, false,
 						   MAX_SCHEDULE_TIMEOUT);
+			for (i = 0; i < count; ++i)
+				fence_put(fences[i]);
+
 			r = (t > 0) ? 0 : t;
 			spin_lock(&sa_manager->wq.lock);
 		} else {


Patches currently in stable-queue which might be from nicolai.haehnle@amd.com are

queue-4.4/drm-amdgpu-remove-unnecessary-forward-declaration.patch
queue-4.4/drm-amdgpu-hold-reference-to-fences-in-amdgpu_sa_bo_new-v2.patch


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-03-01 19:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-01 19:49 Patch "drm/amdgpu: hold reference to fences in amdgpu_sa_bo_new (v2)" has been added to the 4.4-stable tree gregkh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.