Skip to contentSkip to conversation

drm/radeon: fix a semaphore deadlock on pre cayman asics

PATCH In review Christian König 2 participants 2 messages Mar 7, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/radeon: fix a semaphore deadlock on pre cayman asics

The out of order execution of semaphore commands on pre cayman asics doesn't work correctly and can cause deadlocks, so turn it off for now.

---
 drivers/gpu/drm/radeon/r600.c  |    3 +++
 drivers/gpu/drm/radeon/r600d.h |    1 +
 2 files changed, 4 insertions(+), 0 deletions(-)
drivers/gpu/drm/radeon/r600.c +3 -0
index 8a6d68c..f0b3323 100644
@@ -2362,6 +2362,9 @@ void r600_semaphore_ring_emit(struct radeon_device *rdev,
 	uint64_t addr = semaphore->gpu_addr;
 	unsigned sel = emit_wait ? PACKET3_SEM_SEL_WAIT : PACKET3_SEM_SEL_SIGNAL;
 
+	if (rdev->family < CHIP_CAYMAN)
+		sel |= PACKET3_SEM_WAIT_ON_SIGNAL;
+
 	radeon_ring_write(ring, PACKET3(PACKET3_MEM_SEMAPHORE, 1));
 	radeon_ring_write(ring, addr & 0xffffffff);
 	radeon_ring_write(ring, (upper_32_bits(addr) & 0xff) | sel);
drivers/gpu/drm/radeon/r600d.h +1 -0
index 2ba460b..8ae328f 100644
@@ -850,6 +850,7 @@
 #define	PACKET3_STRMOUT_BUFFER_UPDATE			0x34
 #define	PACKET3_INDIRECT_BUFFER_MP			0x38
 #define	PACKET3_MEM_SEMAPHORE				0x39
+#              define PACKET3_SEM_WAIT_ON_SIGNAL    (0x1 << 12)
 #              define PACKET3_SEM_SEL_SIGNAL	    (0x6 << 29)
 #              define PACKET3_SEM_SEL_WAIT	    (0x7 << 29)
 #define	PACKET3_MPEG_INDEX				0x3A
Signature · 6 lines
1.7.5.4

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 1/1
#1 lore raw

2012/3/7 Christian König <[email protected]>:

Quoted 5 lines

The out of order execution of semaphore commands on pre cayman asics doesn't work correctly and can cause deadlocks, so turn it off for now.

Good catch.

Quoted 38 lines

---
 drivers/gpu/drm/radeon/r600.c  |    3 +++
 drivers/gpu/drm/radeon/r600d.h |    1 +

 2 files changed, 4 insertions(+), 0 deletions(-)
drivers/gpu/drm/radeon/r600.c +3 -0
index 8a6d68c..f0b3323 100644
@@ -2362,6 +2362,9 @@ void r600_semaphore_ring_emit(struct radeon_device *rdev,
        uint64_t addr = semaphore->gpu_addr;
        unsigned sel = emit_wait ? PACKET3_SEM_SEL_WAIT : PACKET3_SEM_SEL_SIGNAL;
 
+       if (rdev->family < CHIP_CAYMAN)
+               sel |= PACKET3_SEM_WAIT_ON_SIGNAL;
+
        radeon_ring_write(ring, PACKET3(PACKET3_MEM_SEMAPHORE, 1));
        radeon_ring_write(ring, addr & 0xffffffff);
        radeon_ring_write(ring, (upper_32_bits(addr) & 0xff) | sel);
drivers/gpu/drm/radeon/r600d.h +1 -1
index 2ba460b..8ae328f 100644
@@ -850,6 +850,7 @@
  #define        PACKET3_STRMOUT_BUFFER_UPDATE                   0x34
  #define        PACKET3_INDIRECT_BUFFER_MP                      0x38
  #define        PACKET3_MEM_SEMAPHORE                           0x39
+#              define PACKET3_SEM_WAIT_ON_SIGNAL    (0x1 << 12)
  #              define PACKET3_SEM_SEL_SIGNAL       (0x6 << 29)
  #              define PACKET3_SEM_SEL_WAIT         (0x7 << 29)
  #define        PACKET3_MPEG_INDEX                              0x3A
--

1.7.5.4

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel