Skip to contentSkip to conversation

drm/radeon/kms: R3XX-R4XX fix GPU reset code

PATCH In review Jerome Glisse 2 participants 2 messages Apr 26, 2010 – Apr 29, 2010

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

PATCH 1/1 drm/radeon/kms: R3XX-R4XX fix GPU reset code

Previous reset code leaded to computer hard lockup (need to unplug the power too reboot the computer) on various configuration. This patch change the reset code to avoid hard lockup. The GPU reset is failing most of the time but at least user can log in remotely or properly shutdown the computer.

Two issues were leading to hard lockup :
- Writting to the scratch register lead to hard lockup most likely because the write back mecanism is in fuzy state after GPU lockup.
- Resetting the GPU memory controller and not reinitializing it after leaded to hard lockup. We did only reinitialize in case of successfull reset thus unsuccessfull reset quickly leaded to hard lockup.

---
 drivers/gpu/drm/radeon/r300.c         |    8 --------
 drivers/gpu/drm/radeon/radeon_fence.c |    2 +-
 2 files changed, 1 insertions(+), 9 deletions(-)
drivers/gpu/drm/radeon/r300.c +0 -8
index bb005bf..5d622cb 100644
@@ -445,14 +445,6 @@ int r300_asic_reset(struct radeon_device *rdev)
 	mdelay(1);
 	status = RREG32(R_000E40_RBBM_STATUS);
 	dev_info(rdev->dev, "(%s:%d) RBBM_STATUS=0x%08X\n", __func__, __LINE__, status);
-	/* reset MC */
-	WREG32(R_0000F0_RBBM_SOFT_RESET, S_0000F0_SOFT_RESET_MC(1));
-	RREG32(R_0000F0_RBBM_SOFT_RESET);
-	mdelay(500);
-	WREG32(R_0000F0_RBBM_SOFT_RESET, 0);
-	mdelay(1);
-	status = RREG32(R_000E40_RBBM_STATUS);
-	dev_info(rdev->dev, "(%s:%d) RBBM_STATUS=0x%08X\n", __func__, __LINE__, status);
 	/* restore PCI & busmastering */
 	pci_restore_state(rdev->pdev);
 	r100_enable_bm(rdev);
drivers/gpu/drm/radeon/radeon_fence.c +1 -1
index 1b8b9cc..b1f9a81 100644
@@ -237,10 +237,10 @@ retry:
 			 * as signaled for now
 			 */
 			rdev->gpu_lockup = true;
-			WREG32(rdev->fence_drv.scratch_reg, fence->seq);
 			r = radeon_gpu_reset(rdev);
 			if (r)
 				return r;
+			WREG32(rdev->fence_drv.scratch_reg, fence->seq);
 			rdev->gpu_lockup = false;
 		}
 		timeout = RADEON_FENCE_JIFFIES_TIMEOUT;
Signature · 1 line
1.7.0.1
#1 lore raw
Quoted 14 lines · Jerome Glisse

Previous reset code leaded to computer hard lockup (need to unplug the power too reboot the computer) on various configuration. This patch change the reset code to avoid hard lockup. The GPU reset is failing most of the time but at least user can log in remotely or properly shutdown the computer.

Two issues were leading to hard lockup :
- Writting to the scratch register lead to hard lockup most likely because the write back mecanism is in fuzy state after GPU lockup.
- Resetting the GPU memory controller and not reinitializing it after leaded to hard lockup. We did only reinitialize in case of successfull reset thus unsuccessfull reset quickly leaded to hard lockup.

Quoted 1 line

Unfortunately, this doesn't seem to help for the RV350 in my PowerBook. GPU lockups still turn into machine hardlocks, which is a regression from before the GPU reset rework.

Signature · 6 lines
Earthling Michel Dänzer           |                http://www.vmware.com
Libre software enthusiast         |          Debian, X and DRI developer
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel