mirror of
https://github.com/torvalds/linux.git
synced 2026-05-05 06:52:34 -04:00
drm/amdgpu/virt: add wait_reset virt ops
Driver can use this interface to check if there's a function level reset done in hypervisor. It's helpful when IRQ handler for reset is not ready, or special handling is required. Acked-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Monk Liu <monk.liu@amd.com> Signed-off-by: pding <Pixel.Ding@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
@@ -235,6 +235,22 @@ int amdgpu_virt_reset_gpu(struct amdgpu_device *adev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* amdgpu_virt_wait_reset() - wait for reset gpu completed
|
||||
* @amdgpu: amdgpu device.
|
||||
* Wait for GPU reset completed.
|
||||
* Return: Zero if reset success, otherwise will return error.
|
||||
*/
|
||||
int amdgpu_virt_wait_reset(struct amdgpu_device *adev)
|
||||
{
|
||||
struct amdgpu_virt *virt = &adev->virt;
|
||||
|
||||
if (!virt->ops || !virt->ops->wait_reset)
|
||||
return -EINVAL;
|
||||
|
||||
return virt->ops->wait_reset(adev);
|
||||
}
|
||||
|
||||
/**
|
||||
* amdgpu_virt_alloc_mm_table() - alloc memory for mm table
|
||||
* @amdgpu: amdgpu device.
|
||||
|
||||
Reference in New Issue
Block a user