diff mbox

[1/5] drm/radeon: rework and fix reset detection v2

Message ID 5278EDF0.2000503@vodafone.de (mailing list archive)
State New, archived
Headers show

Commit Message

Christian König Nov. 5, 2013, 1:09 p.m. UTC
Am 03.11.2013 13:15, schrieb Rafa? Mi?ecki:
> 2013/10/29 Christian König <deathsimple@vodafone.de>:
>> From: Christian König <christian.koenig@amd.com>
>>
>> Stop fiddling with jiffies, always wait for RADEON_FENCE_JIFFIES_TIMEOUT.
>> Consolidate the two wait sequence implementations into just one function.
>> Activate all waiters and remember if the reset was already done instead of
>> trying to reset from only one thread.
> With this patch I can't suspend my Samsung with:
> 01:00.0 VGA compatible controller [0300]: Advanced Micro Devices [AMD]
> nee ATI Blackcomb [Radeon HD 6900M series] [1002:6720]
> anymore.
>
> The backlight goes off, activity LED goes off and then nothing.
> Machine is still running and other lights (power, wifi, keyboard,
> touchpad) are still working. Seems like a lockup to me.

Does the attached patch help?

Cheers,
Christian.

Comments

Rafał Miłecki Nov. 5, 2013, 1:30 p.m. UTC | #1
2013/11/5 Christian König <deathsimple@vodafone.de>:
> Am 03.11.2013 13:15, schrieb Rafa? Mi?ecki:
>
>> 2013/10/29 Christian König <deathsimple@vodafone.de>:
>>>
>>> From: Christian König <christian.koenig@amd.com>
>>>
>>> Stop fiddling with jiffies, always wait for RADEON_FENCE_JIFFIES_TIMEOUT.
>>> Consolidate the two wait sequence implementations into just one function.
>>> Activate all waiters and remember if the reset was already done instead
>>> of
>>> trying to reset from only one thread.
>>
>> With this patch I can't suspend my Samsung with:
>> 01:00.0 VGA compatible controller [0300]: Advanced Micro Devices [AMD]
>> nee ATI Blackcomb [Radeon HD 6900M series] [1002:6720]
>> anymore.
>>
>> The backlight goes off, activity LED goes off and then nothing.
>> Machine is still running and other lights (power, wifi, keyboard,
>> touchpad) are still working. Seems like a lockup to me.
>
>
> Does the attached patch help?

It does, thanks!
diff mbox

Patch

From ae595cb2728002781c952b43bdab471be2466428 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Christian=20K=C3=B6nig?= <christian.koenig@amd.com>
Date: Mon, 4 Nov 2013 16:50:51 +0100
Subject: [PATCH] drm/radeon: fix radeon_fence_wait_empty_locked
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

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(+)

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)
-- 
1.8.1.2