Skip to contentSkip to conversation

drm/radeon: resume fence driver to last sync sequence on lockup

PATCH In review [email protected] 2 participants 5 messages Dec 14, 2012 – Dec 17, 2012

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

PATCH 1/1 drm/radeon: resume fence driver to last sync sequence on lockup

From: Jerome Glisse <[email protected]>

After lockup we need to resume fence to last sync sequence and not last received sequence so that all thread waiting on command stream that lockedup resume. Otherwise GPU reset will be ineffective in most cases.

---
 drivers/gpu/drm/radeon/radeon_fence.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/radeon/radeon_fence.c +1 -1
index 22bd6c2..38233e7 100644
@@ -787,7 +787,7 @@ int radeon_fence_driver_start_ring(struct radeon_device *rdev, int ring)
 	}
 	rdev->fence_drv[ring].cpu_addr = &rdev->wb.wb[index/4];
 	rdev->fence_drv[ring].gpu_addr = rdev->wb.gpu_addr + index;
-	radeon_fence_write(rdev, atomic64_read(&rdev->fence_drv[ring].last_seq), ring);
+	radeon_fence_write(rdev, rdev->fence_drv[ring].sync_seq[ring], ring);
 	rdev->fence_drv[ring].initialized = true;
 	dev_info(rdev->dev, "fence driver on ring %d use gpu addr 0x%016llx and cpu addr 0x%p\n",
 		 ring, rdev->fence_drv[ring].gpu_addr, rdev->fence_drv[ring].cpu_addr);
Signature · 1 line
1.7.11.7
#1 lore raw
Quoted 6 lines · On 14.12.2012 18:39, [email protected] wrote:

From: Jerome Glisse <[email protected]>

After lockup we need to resume fence to last sync sequence and not last received sequence so that all thread waiting on command stream that lockedup resume. Otherwise GPU reset will be ineffective in most cases.

NAK. I changed this on purpose to get partial resets working, please don't change it back.

The IB test code should reset this to the last synced value anyway, if it doesn't work then there is something wrong there.

Christian.

Quoted 19 lines
---
  drivers/gpu/drm/radeon/radeon_fence.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/radeon/radeon_fence.c +1 -1
index 22bd6c2..38233e7 100644
@@ -787,7 +787,7 @@ int radeon_fence_driver_start_ring(struct radeon_device *rdev, int ring)
  	}
  	rdev->fence_drv[ring].cpu_addr = &rdev->wb.wb[index/4];
  	rdev->fence_drv[ring].gpu_addr = rdev->wb.gpu_addr + index;
-	radeon_fence_write(rdev, atomic64_read(&rdev->fence_drv[ring].last_seq), ring);
+	radeon_fence_write(rdev, rdev->fence_drv[ring].sync_seq[ring], ring);
  	rdev->fence_drv[ring].initialized = true;
  	dev_info(rdev->dev, "fence driver on ring %d use gpu addr 0x%016llx and cpu addr 0x%p\n",
  		 ring, rdev->fence_drv[ring].gpu_addr, rdev->fence_drv[ring].cpu_addr);
#2 lore raw
Quoted 9 lines · Christian König
Quoted 7 lines · On 14.12.2012 18:39, [email protected] wrote:

From: Jerome Glisse <[email protected]>

After lockup we need to resume fence to last sync sequence and not last received sequence so that all thread waiting on command stream that lockedup resume. Otherwise GPU reset will be ineffective in most cases.

Quoted 7 lines

NAK. I changed this on purpose to get partial resets working, please don't change it back.

The IB test code should reset this to the last synced value anyway, if it doesn't work then there is something wrong there.

Christian.

There is something wrong ....

Jerome

#3 lore raw
Quoted 9 lines · Jerome Glisse
Quoted 7 lines · Christian König
Quoted 6 lines · On 14.12.2012 18:39, [email protected] wrote:

From: Jerome Glisse <[email protected]>

After lockup we need to resume fence to last sync sequence and not last received sequence so that all thread waiting on command stream that lockedup resume. Otherwise GPU reset will be ineffective in most cases.

Quoted 8 lines
Quoted 7 lines

NAK. I changed this on purpose to get partial resets working, please don't change it back.

The IB test code should reset this to the last synced value anyway, if it doesn't work then there is something wrong there.

Christian.

There is something wrong ....

What symptoms? What exactly is going wrong?

Thinking about it the sequence probably won't get reseted when we encounter a unrecoverable GPU lockup. And even when the partial GPU reset fails it might be a good idea to reset the fence sequence like this....

Ok, you're right there is something wrong. Going to write a patch for this...

Cheers,
Christian.

#4 lore raw
Quoted 32 lines · Christian König
Quoted 17 lines · Jerome Glisse
Quoted 14 lines · Christian König
Quoted 7 lines · On 14.12.2012 18:39, [email protected] wrote:

From: Jerome Glisse <[email protected]>

After lockup we need to resume fence to last sync sequence and not last received sequence so that all thread waiting on command stream that lockedup resume. Otherwise GPU reset will be ineffective in most cases.

NAK. I changed this on purpose to get partial resets working, please don't
change it back.

Quoted 6 lines
Quoted 4 lines

The IB test code should reset this to the last synced value anyway, if it doesn't work then there is something wrong there.

Christian.

There is something wrong ....

What symptoms? What exactly is going wrong?

Thinking about it the sequence probably won't get reseted when we encounter a unrecoverable GPU lockup. And even when the partial GPU reset fails it might be a good idea to reset the fence sequence like this....

Quoted 5 lines

Ok, you're right there is something wrong. Going to write a patch for this...

Cheers,
Christian.

I already sent a patch that fix most of the issue. But for failed GPU reset we need to write it.

Cheers,
Jerome