All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/radeon: make 64bit fences more robust v3 (3.5 stable)
@ 2012-09-20 14:57 alexdeucher
  2012-09-26 23:40 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: alexdeucher @ 2012-09-20 14:57 UTC (permalink / raw)
  To: airlied, stable, dri-devel; +Cc: Alex Deucher

From: Christian König <deathsimple@vodafone.de>

Only increase the higher 32bits if we really detect a wrap around.

v2: instead of increasing the higher 32bits just use the higher
    32bits from the last emitted fence.
v3: also use last emitted fence value as upper limit.

The intention of this patch is to make fences as robust as
they where before introducing 64bit fences. This is
necessary because on older systems it looks like the fence
value gets corrupted on initialization.

Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=51344

Should also fix:
https://bugs.freedesktop.org/show_bug.cgi?id=54129
https://bugs.freedesktop.org/show_bug.cgi?id=54662
https://bugzilla.redhat.com/show_bug.cgi?id=846505
https://bugzilla.redhat.com/show_bug.cgi?id=845639

This is the 3.5 stable version of the patch:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commitdiff;h=f492c171a38d77fc13a8998a0721f2da50835224
3.4 and previous kernels do not need to be patched.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/radeon/radeon_fence.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_fence.c b/drivers/gpu/drm/radeon/radeon_fence.c
index 11f5f40..71298ce 100644
--- a/drivers/gpu/drm/radeon/radeon_fence.c
+++ b/drivers/gpu/drm/radeon/radeon_fence.c
@@ -75,7 +75,7 @@ int radeon_fence_emit(struct radeon_device *rdev, struct radeon_fence *fence)
 
 void radeon_fence_process(struct radeon_device *rdev, int ring)
 {
-	uint64_t seq, last_seq;
+	uint64_t seq, last_seq, last_emitted;
 	unsigned count_loop = 0;
 	bool wake = false;
 
@@ -102,13 +102,15 @@ void radeon_fence_process(struct radeon_device *rdev, int ring)
 	 */
 	last_seq = atomic64_read(&rdev->fence_drv[ring].last_seq);
 	do {
+		last_emitted = rdev->fence_drv[ring].seq;
 		seq = radeon_fence_read(rdev, ring);
 		seq |= last_seq & 0xffffffff00000000LL;
 		if (seq < last_seq) {
-			seq += 0x100000000LL;
+			seq &= 0xffffffff;
+			seq |= last_emitted & 0xffffffff00000000LL;
 		}
 
-		if (seq == last_seq) {
+		if (seq <= last_seq || seq > last_emitted) {
 			break;
 		}
 		/* If we loop over we don't want to return without
-- 
1.7.7.5

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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] drm/radeon: make 64bit fences more robust v3 (3.5 stable)
  2012-09-20 14:57 [PATCH] drm/radeon: make 64bit fences more robust v3 (3.5 stable) alexdeucher
@ 2012-09-26 23:40 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2012-09-26 23:40 UTC (permalink / raw)
  To: alexdeucher; +Cc: Alex Deucher, dri-devel, stable

On Thu, Sep 20, 2012 at 10:57:01AM -0400, alexdeucher@gmail.com wrote:
> From: Christian König <deathsimple@vodafone.de>
> 
> Only increase the higher 32bits if we really detect a wrap around.
> 
> v2: instead of increasing the higher 32bits just use the higher
>     32bits from the last emitted fence.
> v3: also use last emitted fence value as upper limit.
> 
> The intention of this patch is to make fences as robust as
> they where before introducing 64bit fences. This is
> necessary because on older systems it looks like the fence
> value gets corrupted on initialization.
> 
> Fixes:
> https://bugs.freedesktop.org/show_bug.cgi?id=51344
> 
> Should also fix:
> https://bugs.freedesktop.org/show_bug.cgi?id=54129
> https://bugs.freedesktop.org/show_bug.cgi?id=54662
> https://bugzilla.redhat.com/show_bug.cgi?id=846505
> https://bugzilla.redhat.com/show_bug.cgi?id=845639
> 
> This is the 3.5 stable version of the patch:
> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commitdiff;h=f492c171a38d77fc13a8998a0721f2da50835224
> 3.4 and previous kernels do not need to be patched.
> 
> Signed-off-by: Christian König <deathsimple@vodafone.de>
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

Thanks, now applied.

greg k-h

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-09-26 23:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-20 14:57 [PATCH] drm/radeon: make 64bit fences more robust v3 (3.5 stable) alexdeucher
2012-09-26 23:40 ` Greg KH

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.