diff mbox

drm/radeon: fix radeon_fence_wait_empty_locked

Message ID 1383656994-2072-1-git-send-email-deathsimple@vodafone.de (mailing list archive)
State Accepted
Headers show

Commit Message

Christian König Nov. 5, 2013, 1:09 p.m. UTC
From: Christian König <christian.koenig@amd.com>

Don't block forever if there is nothing to wait for.

Signed-off-by: Christian König <christian.koenig@amd.com>
---
 drivers/gpu/drm/radeon/radeon_fence.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Rafał Miłecki Nov. 5, 2013, 1:31 p.m. UTC | #1
2013/11/5 Christian König <deathsimple@vodafone.de>:
> From: Christian König <christian.koenig@amd.com>
>
> Don't block forever if there is nothing to wait for.
>
> Signed-off-by: Christian König <christian.koenig@amd.com>

Tested-by: Rafa? Mi?ecki <zajec5@gmail.com>
diff mbox

Patch

diff --git a/drivers/gpu/drm/radeon/radeon_fence.c b/drivers/gpu/drm/radeon/radeon_fence.c
index b8f68b2..281d14c 100644
--- a/drivers/gpu/drm/radeon/radeon_fence.c
+++ b/drivers/gpu/drm/radeon/radeon_fence.c
@@ -510,6 +510,9 @@  int radeon_fence_wait_empty_locked(struct radeon_device *rdev, int ring)
 	int r;
 
 	seq[ring] = rdev->fence_drv[ring].sync_seq[ring];
+	if (!seq[ring])
+		return 0;
+
 	r = radeon_fence_wait_seq(rdev, seq, false, false);
 	if (r) {
 		if (r == -EDEADLK)