All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <deathsimple@vodafone.de>
To: dri-devel@lists.freedesktop.org
Subject: [PATCH 02/15] drm/radeon: add error handling to radeon_vm_unbind_locked
Date: Tue, 10 Jul 2012 14:51:11 +0200	[thread overview]
Message-ID: <1341924684-563-2-git-send-email-deathsimple@vodafone.de> (raw)
In-Reply-To: <1341924684-563-1-git-send-email-deathsimple@vodafone.de>

Waiting for a fence can fail for different reasons,
the most common is a deadlock.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
---
 drivers/gpu/drm/radeon/radeon_gart.c |   17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_gart.c b/drivers/gpu/drm/radeon/radeon_gart.c
index 2b34c1a..ee11c50 100644
--- a/drivers/gpu/drm/radeon/radeon_gart.c
+++ b/drivers/gpu/drm/radeon/radeon_gart.c
@@ -316,10 +316,21 @@ static void radeon_vm_unbind_locked(struct radeon_device *rdev,
 	}
 
 	/* wait for vm use to end */
-	if (vm->fence) {
-		radeon_fence_wait(vm->fence, false);
-		radeon_fence_unref(&vm->fence);
+	while (vm->fence) {
+		int r;
+		r = radeon_fence_wait(vm->fence, false);
+		if (r)
+			DRM_ERROR("error while waiting for fence: %d\n", r);
+		if (r == -EDEADLK) {
+			mutex_unlock(&rdev->vm_manager.lock);
+			r = radeon_gpu_reset(rdev);
+			mutex_lock(&rdev->vm_manager.lock);
+			if (!r)
+				continue;
+		}
+		break;
 	}
+	radeon_fence_unref(&vm->fence);
 
 	/* hw unbind */
 	rdev->vm_manager.funcs->unbind(rdev, vm);
-- 
1.7.9.5

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2012-07-10 12:51 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-10 12:51 [PATCH 01/15] drm/radeon: add error handling to fence_wait_empty_locked Christian König
2012-07-10 12:51 ` Christian König [this message]
2012-07-10 12:51 ` [PATCH 03/15] drm/radeon: fix fence related segfault in CS Christian König
2012-07-10 12:51 ` [PATCH 04/15] drm/radeon: add an exclusive lock for GPU reset v2 Christian König
2012-07-10 12:51 ` [PATCH 05/15] drm/radeon: fix ring commit padding Christian König
2012-07-10 12:51 ` [PATCH 06/15] drm/radeon: fix fence value access Christian König
2012-07-10 12:51 ` [PATCH 07/15] drm/radeon: fix fence init after resume Christian König
2012-07-10 12:51 ` [PATCH 08/15] drm/radeon: remove FIXME comment from chipset suspend Christian König
2012-07-10 12:51 ` [PATCH 09/15] drm/radeon: make cp init on cayman more robust Christian König
2012-07-10 12:51 ` [PATCH 10/15] drm/radeon: remove ip_pool start/suspend Christian König
2012-07-10 12:51 ` [PATCH 11/15] drm/radeon: remove r600_blit_suspend Christian König
2012-07-10 12:51 ` [PATCH 12/15] drm/radeon: remove vm_manager start/suspend Christian König
2012-07-10 12:51 ` [PATCH 13/15] drm/radeon: move radeon_ib_ring_tests out of chipset code Christian König
2012-07-10 12:51 ` [PATCH 14/15] drm/radeon: record what is next valid wptr for each ring v2 Christian König
2012-07-10 16:56   ` Jerome Glisse
2012-07-11  8:08     ` Christian König
2012-07-10 12:51 ` [PATCH 15/15] drm/radeon: implement ring saving on reset v2 Christian König
2012-07-10 14:50   ` Michel Dänzer
2012-07-12 16:12 Ring saving patches round 3 Christian König
2012-07-12 16:12 ` [PATCH 02/15] drm/radeon: add error handling to radeon_vm_unbind_locked Christian König

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1341924684-563-2-git-send-email-deathsimple@vodafone.de \
    --to=deathsimple@vodafone.de \
    --cc=dri-devel@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.