mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-08 11:41:37 -04:00
drm/amdgpu/sdma6: properly reference trap interrupts for userqs
We need to take a reference to the interrupts to make sure they stay enabled even if the kernel queues have disabled them. Reviewed-by: Sunil Khatri <sunil.khatri@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
@@ -1377,11 +1377,39 @@ static int sdma_v6_0_sw_fini(struct amdgpu_ip_block *ip_block)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int sdma_v6_0_set_userq_trap_interrupts(struct amdgpu_device *adev,
|
||||
bool enable)
|
||||
{
|
||||
unsigned int irq_type;
|
||||
int i, r;
|
||||
|
||||
if (adev->userq_funcs[AMDGPU_HW_IP_DMA]) {
|
||||
for (i = 0; i < adev->sdma.num_instances; i++) {
|
||||
irq_type = AMDGPU_SDMA_IRQ_INSTANCE0 + i;
|
||||
if (enable)
|
||||
r = amdgpu_irq_get(adev, &adev->sdma.trap_irq,
|
||||
irq_type);
|
||||
else
|
||||
r = amdgpu_irq_put(adev, &adev->sdma.trap_irq,
|
||||
irq_type);
|
||||
if (r)
|
||||
return r;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int sdma_v6_0_hw_init(struct amdgpu_ip_block *ip_block)
|
||||
{
|
||||
struct amdgpu_device *adev = ip_block->adev;
|
||||
int r;
|
||||
|
||||
return sdma_v6_0_start(adev);
|
||||
r = sdma_v6_0_start(adev);
|
||||
if (r)
|
||||
return r;
|
||||
|
||||
return sdma_v6_0_set_userq_trap_interrupts(adev, true);
|
||||
}
|
||||
|
||||
static int sdma_v6_0_hw_fini(struct amdgpu_ip_block *ip_block)
|
||||
@@ -1393,6 +1421,7 @@ static int sdma_v6_0_hw_fini(struct amdgpu_ip_block *ip_block)
|
||||
|
||||
sdma_v6_0_ctxempty_int_enable(adev, false);
|
||||
sdma_v6_0_enable(adev, false);
|
||||
sdma_v6_0_set_userq_trap_interrupts(adev, false);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user