drm/radeon: fix semaphore value init
Subsystems (2)
PATCH 1/1 drm/radeon: fix semaphore value init
From: Christian König <[email protected]>
Semaphore values have 64 bits, not 32. This fixes a very subtle bug that disables synchronization when the upper 32bits wasn't zero.
--- drivers/gpu/drm/radeon/radeon_semaphore.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/radeon/radeon_semaphore.c +1 -1
@@ -34,7 +34,7 @@int radeon_semaphore_create (struct radeon_device *rdev,struct radeon_semaphore **semaphore) { -uint32_t *cpu_addr; +uint64_t *cpu_addr;int i, r; *semaphore =kmalloc (sizeof (struct radeon_semaphore ),GFP_KERNEL );
Signature · 6 lines
1.9.1 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 5 lines · Christian König
From: Christian König <[email protected]>
Semaphore values have 64 bits, not 32. This fixes a very subtle bug that disables synchronization when the upper 32bits wasn't zero.
So essentially, half the semaphore values were never properly initialized and some loads with a lot of semaphore synchronization going on tried to use the uninitialized semaphores. I think the description in the commit could be improved according to that.
I didn't get any DMA L2T copy hangs with semaphores disabled completely, but unfortunately this doesn't fix the hangs.
Anyway,
Grigori
Quoted 12 lines
Signed-off-by Christian König <[email protected]>--- drivers/gpu/drm/radeon/radeon_semaphore.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/radeon/radeon_semaphore.c +0
-0
drivers/gpu/drm/radeon/radeon_semaphore.c line 40
Quoted 8 lines
drivers/gpu/drm/radeon/radeon_semaphore.c +1
-1@@ -34,7 +34,7 @@int radeon_semaphore_create (struct radeon_device *rdev,struct radeon_semaphore **semaphore) { -uint32_t *cpu_addr; +uint64_t *cpu_addr;int i, r; *semaphore =kmalloc (sizeof (struct radeon_semaphore ),GFP_KERNEL );
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Am 07.09.2014 um 19:41 schrieb Grigori Goronzy:
Quoted 10 lines · Christian König
Quoted 5 lines
From: Christian König <[email protected]>
Semaphore values have 64 bits, not 32. This fixes a very subtle bug that disables synchronization when the upper 32bits wasn't zero.
So essentially, half the semaphore values were never properly initialized and some loads with a lot of semaphore synchronization going on tried to use the uninitialized semaphores. I think the description in the commit could be improved according to that.
Thinking about it that's actually not correct either.
What we did here was allocating space for four semaphores, but only initializing the first two because the pointer didn't had the correct size.
Needing more than two semaphores is rather unlikely anyway and even then we would have only messed up the syncing to UVD or VCE which wouldn't cause a lockup. I don't think we ever hit this bug in practice.
Quoted 2 lines
I didn't get any DMA L2T copy hangs with semaphores disabled completely, but unfortunately this doesn't fix the hangs.
As expected, I just found it while going over the code once more. My suspicion with your L2T copy problems is that we either do something wrong with the tilling setup on the DMA engines or that we still do something wrong with the VM setup, but since you don't see any VM related messages it's not very likely that it's a VM issue.
We should probably try to get a bit more infos from the DMA status registers, but I'm not sure if we have released the documentation for those yet.
Quoted 2 lines
Anyway,
Reviewed-by Grigori Goronzy <[email protected]>
Thanks,
Christian.
Quoted 21 lines
Grigori
Quoted 18 lines
Signed-off-by Christian König <[email protected]>--- drivers/gpu/drm/radeon/radeon_semaphore.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/radeon/radeon_semaphore.c +1
-1@@ -34,7 +34,7 @@int radeon_semaphore_create (struct radeon_device *rdev,struct radeon_semaphore **semaphore) { -uint32_t *cpu_addr; +uint64_t *cpu_addr;int i, r;
Quoted 3 lines
drivers/gpu/drm/radeon/radeon_semaphore.c line 40
Quoted 2 lines
drivers/gpu/drm/radeon/radeon_semaphore.c +0
-0*semaphore =kmalloc (sizeof (struct radeon_semaphore ),GFP_KERNEL );
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Alex Deucher
AppliedQuoted 7 lines · Christian König
From: Christian König <[email protected]>
Semaphore values have 64 bits, not 32. This fixes a very subtle bug that disables synchronization when the upper 32bits wasn't zero.
Signed-off-by Christian König <[email protected]>
Applied to my fixes tree. thanks!
Alex
Quoted 20 lines
--- drivers/gpu/drm/radeon/radeon_semaphore.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/radeon/radeon_semaphore.c +1
-2@@ -34,7 +34,7 @@int radeon_semaphore_create (struct radeon_device *rdev,struct radeon_semaphore **semaphore) { -uint32_t *cpu_addr; +uint64_t *cpu_addr;int i, r; *semaphore =kmalloc (sizeof (struct radeon_semaphore ),GFP_KERNEL ); --1.9.1
Quoted 4 lines
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel