diff options
author | Jerome Glisse <jglisse@redhat.com> | 2013-01-02 17:30:35 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2013-01-03 13:18:41 -0500 |
commit | 64c56e8ce377842c8c8ff41054530480c7128c0b (patch) | |
tree | e72cf12a47e467ff5bf664d57698ba510e227c81 /drivers/gpu/drm/radeon/r600.c | |
parent | eaaa6983ab2ccdf826c90838eb584211e0cadb76 (diff) |
drm/radeon: reset dma engine on gpu reset (v2)
This try to reset the dma engine when performing gpu reset. Hopefully
bringing back the gpu dma engine in sane state.
v2: agd5f: fix dma reset on cayman/TN, add support for SI
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/r600.c')
-rw-r--r-- | drivers/gpu/drm/radeon/r600.c | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c index 252067bba2d9..721b5afd792a 100644 --- a/drivers/gpu/drm/radeon/r600.c +++ b/drivers/gpu/drm/radeon/r600.c | |||
@@ -1283,11 +1283,11 @@ static int r600_gpu_soft_reset(struct radeon_device *rdev) | |||
1283 | return 0; | 1283 | return 0; |
1284 | 1284 | ||
1285 | dev_info(rdev->dev, "GPU softreset \n"); | 1285 | dev_info(rdev->dev, "GPU softreset \n"); |
1286 | dev_info(rdev->dev, " R_008010_GRBM_STATUS=0x%08X\n", | 1286 | dev_info(rdev->dev, " R_008010_GRBM_STATUS = 0x%08X\n", |
1287 | RREG32(R_008010_GRBM_STATUS)); | 1287 | RREG32(R_008010_GRBM_STATUS)); |
1288 | dev_info(rdev->dev, " R_008014_GRBM_STATUS2=0x%08X\n", | 1288 | dev_info(rdev->dev, " R_008014_GRBM_STATUS2 = 0x%08X\n", |
1289 | RREG32(R_008014_GRBM_STATUS2)); | 1289 | RREG32(R_008014_GRBM_STATUS2)); |
1290 | dev_info(rdev->dev, " R_000E50_SRBM_STATUS=0x%08X\n", | 1290 | dev_info(rdev->dev, " R_000E50_SRBM_STATUS = 0x%08X\n", |
1291 | RREG32(R_000E50_SRBM_STATUS)); | 1291 | RREG32(R_000E50_SRBM_STATUS)); |
1292 | dev_info(rdev->dev, " R_008674_CP_STALLED_STAT1 = 0x%08X\n", | 1292 | dev_info(rdev->dev, " R_008674_CP_STALLED_STAT1 = 0x%08X\n", |
1293 | RREG32(CP_STALLED_STAT1)); | 1293 | RREG32(CP_STALLED_STAT1)); |
@@ -1303,8 +1303,24 @@ static int r600_gpu_soft_reset(struct radeon_device *rdev) | |||
1303 | if (r600_mc_wait_for_idle(rdev)) { | 1303 | if (r600_mc_wait_for_idle(rdev)) { |
1304 | dev_warn(rdev->dev, "Wait for MC idle timedout !\n"); | 1304 | dev_warn(rdev->dev, "Wait for MC idle timedout !\n"); |
1305 | } | 1305 | } |
1306 | |||
1306 | /* Disable CP parsing/prefetching */ | 1307 | /* Disable CP parsing/prefetching */ |
1307 | WREG32(R_0086D8_CP_ME_CNTL, S_0086D8_CP_ME_HALT(1)); | 1308 | WREG32(R_0086D8_CP_ME_CNTL, S_0086D8_CP_ME_HALT(1)); |
1309 | |||
1310 | /* Disable DMA */ | ||
1311 | tmp = RREG32(DMA_RB_CNTL); | ||
1312 | tmp &= ~DMA_RB_ENABLE; | ||
1313 | WREG32(DMA_RB_CNTL, tmp); | ||
1314 | |||
1315 | /* Reset dma */ | ||
1316 | if (rdev->family >= CHIP_RV770) | ||
1317 | WREG32(SRBM_SOFT_RESET, RV770_SOFT_RESET_DMA); | ||
1318 | else | ||
1319 | WREG32(SRBM_SOFT_RESET, SOFT_RESET_DMA); | ||
1320 | RREG32(SRBM_SOFT_RESET); | ||
1321 | udelay(50); | ||
1322 | WREG32(SRBM_SOFT_RESET, 0); | ||
1323 | |||
1308 | /* Check if any of the rendering block is busy and reset it */ | 1324 | /* Check if any of the rendering block is busy and reset it */ |
1309 | if ((RREG32(R_008010_GRBM_STATUS) & grbm_busy_mask) || | 1325 | if ((RREG32(R_008010_GRBM_STATUS) & grbm_busy_mask) || |
1310 | (RREG32(R_008014_GRBM_STATUS2) & grbm2_busy_mask)) { | 1326 | (RREG32(R_008014_GRBM_STATUS2) & grbm2_busy_mask)) { |
@@ -1336,11 +1352,11 @@ static int r600_gpu_soft_reset(struct radeon_device *rdev) | |||
1336 | WREG32(R_008020_GRBM_SOFT_RESET, 0); | 1352 | WREG32(R_008020_GRBM_SOFT_RESET, 0); |
1337 | /* Wait a little for things to settle down */ | 1353 | /* Wait a little for things to settle down */ |
1338 | mdelay(1); | 1354 | mdelay(1); |
1339 | dev_info(rdev->dev, " R_008010_GRBM_STATUS=0x%08X\n", | 1355 | dev_info(rdev->dev, " R_008010_GRBM_STATUS = 0x%08X\n", |
1340 | RREG32(R_008010_GRBM_STATUS)); | 1356 | RREG32(R_008010_GRBM_STATUS)); |
1341 | dev_info(rdev->dev, " R_008014_GRBM_STATUS2=0x%08X\n", | 1357 | dev_info(rdev->dev, " R_008014_GRBM_STATUS2 = 0x%08X\n", |
1342 | RREG32(R_008014_GRBM_STATUS2)); | 1358 | RREG32(R_008014_GRBM_STATUS2)); |
1343 | dev_info(rdev->dev, " R_000E50_SRBM_STATUS=0x%08X\n", | 1359 | dev_info(rdev->dev, " R_000E50_SRBM_STATUS = 0x%08X\n", |
1344 | RREG32(R_000E50_SRBM_STATUS)); | 1360 | RREG32(R_000E50_SRBM_STATUS)); |
1345 | dev_info(rdev->dev, " R_008674_CP_STALLED_STAT1 = 0x%08X\n", | 1361 | dev_info(rdev->dev, " R_008674_CP_STALLED_STAT1 = 0x%08X\n", |
1346 | RREG32(CP_STALLED_STAT1)); | 1362 | RREG32(CP_STALLED_STAT1)); |