mirror of
https://github.com/torvalds/linux.git
synced 2026-05-27 08:33:17 +02:00
drm/amdgpu/sdma6: implement ring reset callback for sdma6
Implement sdma queue reset callback using mes_reset_queue_mmio. v2: check instance id before reset queue. Signed-off-by: Jiadong Zhu <Jiadong.Zhu@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
df190e6753
commit
92c9b3e8e4
|
|
@ -1491,6 +1491,31 @@ static int sdma_v6_0_ring_preempt_ib(struct amdgpu_ring *ring)
|
|||
return r;
|
||||
}
|
||||
|
||||
static int sdma_v6_0_reset_queue(struct amdgpu_ring *ring, unsigned int vmid)
|
||||
{
|
||||
struct amdgpu_device *adev = ring->adev;
|
||||
int i, r;
|
||||
|
||||
if (amdgpu_sriov_vf(adev))
|
||||
return -EINVAL;
|
||||
|
||||
for (i = 0; i < adev->sdma.num_instances; i++) {
|
||||
if (ring == &adev->sdma.instance[i].ring)
|
||||
break;
|
||||
}
|
||||
|
||||
if (i == adev->sdma.num_instances) {
|
||||
DRM_ERROR("sdma instance not found\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
r = amdgpu_mes_reset_legacy_queue(adev, ring, vmid, true);
|
||||
if (r)
|
||||
return r;
|
||||
|
||||
return sdma_v6_0_gfx_resume_instance(adev, i, true);
|
||||
}
|
||||
|
||||
static int sdma_v6_0_set_trap_irq_state(struct amdgpu_device *adev,
|
||||
struct amdgpu_irq_src *source,
|
||||
unsigned type,
|
||||
|
|
@ -1674,6 +1699,7 @@ static const struct amdgpu_ring_funcs sdma_v6_0_ring_funcs = {
|
|||
.emit_reg_write_reg_wait = sdma_v6_0_ring_emit_reg_write_reg_wait,
|
||||
.init_cond_exec = sdma_v6_0_ring_init_cond_exec,
|
||||
.preempt_ib = sdma_v6_0_ring_preempt_ib,
|
||||
.reset = sdma_v6_0_reset_queue,
|
||||
};
|
||||
|
||||
static void sdma_v6_0_set_ring_funcs(struct amdgpu_device *adev)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user