Skip to contentSkip to conversation

drm/radeon/kms: r600 reset GPU at module load time

PATCH New Jerome Glisse 1 participant 1 message Jun 4, 2010

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

PATCH 1/1 drm/radeon/kms: r600 reset GPU at module load time

When loading/unloading several time the driver on r600 we end up with the GPU in broken state and loading fail to initialize acceleration. Reset the GPU at load time so acceleration keep working over load/unload.

---
 drivers/gpu/drm/radeon/r600.c |   20 +++++++++++++-------
 1 files changed, 13 insertions(+), 7 deletions(-)
drivers/gpu/drm/radeon/r600.c +13 -7
index 1537079..5fc0525 100644
@@ -1163,13 +1163,6 @@ int r600_gpu_soft_reset(struct radeon_device *rdev)
 			S_008014_CB2_BUSY(1) | S_008014_CB3_BUSY(1);
 	u32 tmp;
 
-	dev_info(rdev->dev, "GPU softreset \n");
-	dev_info(rdev->dev, "  R_008010_GRBM_STATUS=0x%08X\n",
-		RREG32(R_008010_GRBM_STATUS));
-	dev_info(rdev->dev, "  R_008014_GRBM_STATUS2=0x%08X\n",
-		RREG32(R_008014_GRBM_STATUS2));
-	dev_info(rdev->dev, "  R_000E50_SRBM_STATUS=0x%08X\n",
-		RREG32(R_000E50_SRBM_STATUS));
 	rv515_mc_stop(rdev, &save);
 	if (r600_mc_wait_for_idle(rdev)) {
 		dev_warn(rdev->dev, "Wait for MC idle timedout !\n");
@@ -1245,6 +1238,13 @@ bool r600_gpu_is_lockup(struct radeon_device *rdev)
 
 int r600_asic_reset(struct radeon_device *rdev)
 {
+	dev_info(rdev->dev, "GPU softreset \n");
+	dev_info(rdev->dev, "  R_008010_GRBM_STATUS=0x%08X\n",
+		RREG32(R_008010_GRBM_STATUS));
+	dev_info(rdev->dev, "  R_008014_GRBM_STATUS2=0x%08X\n",
+		RREG32(R_008014_GRBM_STATUS2));
+	dev_info(rdev->dev, "  R_000E50_SRBM_STATUS=0x%08X\n",
+		RREG32(R_000E50_SRBM_STATUS));
 	return r600_gpu_soft_reset(rdev);
 }
 
@@ -2460,6 +2460,12 @@ int r600_init(struct radeon_device *rdev)
 		DRM_INFO("GPU not posted. posting now...\n");
 		atom_asic_init(rdev->mode_info.atom_context);
 	}
+
+	/* GPU is sometimes in broken state (especialy after loading/unloading
+	 * the driver several time. Reset the GPU.
+	 */
+	r600_gpu_soft_reset(rdev);
+
 	/* Initialize scratch registers */
 	r600_scratch_init(rdev);
 	/* Initialize surface registers */
Signature · 1 line
1.7.0.1