drm: amdgpu: Use struct drm_wedge_task_info inside of struct amdgpu_task_info

To avoid a cast when calling drm_dev_wedged_event(), replace pid and
task name inside of struct amdgpu_task_info with struct
drm_wedge_task_info.

Reviewed-by: Christian König <christian.koenig@amd.com>
Link: https://lore.kernel.org/r/20250617124949.2151549-6-andrealmeid@igalia.com
Signed-off-by: André Almeida <andrealmeid@igalia.com>
This commit is contained in:
André Almeida
2025-06-17 09:49:48 -03:00
parent cd37124b40
commit 35dc4ce200
9 changed files with 18 additions and 19 deletions

View File

@@ -622,7 +622,7 @@ int amdgpu_vm_validate(struct amdgpu_device *adev, struct amdgpu_vm *vm,
pr_warn_ratelimited("Evicted user BO is not reserved\n");
if (ti) {
pr_warn_ratelimited("pid %d\n", ti->pid);
pr_warn_ratelimited("pid %d\n", ti->task.pid);
amdgpu_vm_put_task_info(ti);
}
@@ -2508,11 +2508,11 @@ void amdgpu_vm_set_task_info(struct amdgpu_vm *vm)
if (!vm->task_info)
return;
if (vm->task_info->pid == current->pid)
if (vm->task_info->task.pid == current->pid)
return;
vm->task_info->pid = current->pid;
get_task_comm(vm->task_info->task_name, current);
vm->task_info->task.pid = current->pid;
get_task_comm(vm->task_info->task.comm, current);
if (current->group_leader->mm != current->mm)
return;
@@ -2775,7 +2775,7 @@ void amdgpu_vm_fini(struct amdgpu_device *adev, struct amdgpu_vm *vm)
dev_warn(adev->dev,
"VM memory stats for proc %s(%d) task %s(%d) is non-zero when fini\n",
ti->process_name, ti->pid, ti->task_name, ti->tgid);
ti->process_name, ti->task.pid, ti->task.comm, ti->tgid);
}
amdgpu_vm_put_task_info(vm->task_info);
@@ -3164,5 +3164,5 @@ void amdgpu_vm_print_task_info(struct amdgpu_device *adev,
dev_err(adev->dev,
" Process %s pid %d thread %s pid %d\n",
task_info->process_name, task_info->tgid,
task_info->task_name, task_info->pid);
task_info->task.comm, task_info->task.pid);
}