aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2017-05-12 10:09:26 -0400
committerAlex Deucher <alexander.deucher@amd.com>2017-05-31 14:16:36 -0400
commit92456b933cd257845587697a0875878849cef973 (patch)
tree58ee3ea1556b720f70ddaf9ce36f027d62c5377d /drivers/gpu/drm
parentb116632557a565dfdc2b7e5f8d67661a3ac3f835 (diff)
drm/amdgpu: add some extra VM error handling
If updating the PDs fails we now invalidate all entries to try again later. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Chunming Zhou <david1.zhou@amd.com> Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c34
1 files changed, 33 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
index c11903257b94..6af2d3c56f38 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -1104,6 +1104,32 @@ error_free:
1104} 1104}
1105 1105
1106/* 1106/*
1107 * amdgpu_vm_invalidate_level - mark all PD levels as invalid
1108 *
1109 * @parent: parent PD
1110 *
1111 * Mark all PD level as invalid after an error.
1112 */
1113static void amdgpu_vm_invalidate_level(struct amdgpu_vm_pt *parent)
1114{
1115 unsigned pt_idx;
1116
1117 /*
1118 * Recurse into the subdirectories. This recursion is harmless because
1119 * we only have a maximum of 5 layers.
1120 */
1121 for (pt_idx = 0; pt_idx <= parent->last_entry_used; ++pt_idx) {
1122 struct amdgpu_vm_pt *entry = &parent->entries[pt_idx];
1123
1124 if (!entry->bo)
1125 continue;
1126
1127 entry->addr = ~0ULL;
1128 amdgpu_vm_invalidate_level(entry);
1129 }
1130}
1131
1132/*
1107 * amdgpu_vm_update_directories - make sure that all directories are valid 1133 * amdgpu_vm_update_directories - make sure that all directories are valid
1108 * 1134 *
1109 * @adev: amdgpu_device pointer 1135 * @adev: amdgpu_device pointer
@@ -1115,7 +1141,13 @@ error_free:
1115int amdgpu_vm_update_directories(struct amdgpu_device *adev, 1141int amdgpu_vm_update_directories(struct amdgpu_device *adev,
1116 struct amdgpu_vm *vm) 1142 struct amdgpu_vm *vm)
1117{ 1143{
1118 return amdgpu_vm_update_level(adev, vm, &vm->root, 0); 1144 int r;
1145
1146 r = amdgpu_vm_update_level(adev, vm, &vm->root, 0);
1147 if (r)
1148 amdgpu_vm_invalidate_level(&vm->root);
1149
1150 return r;
1119} 1151}
1120 1152
1121/** 1153/**