Skip to content

Commit bc3e1d6

Browse files
Horatio Zhangalexdeucher
authored andcommitted
drm/amdgpu: add RAS POISON interrupt funcs for jpeg_v4_0
Add ras_poison_irq and functions. And fix the amdgpu_irq_put call trace in jpeg_v4_0_hw_fini. [ 50.497562] RIP: 0010:amdgpu_irq_put+0xa4/0xc0 [amdgpu] [ 50.497619] RSP: 0018:ffffaa2400fcfcb0 EFLAGS: 00010246 [ 50.497620] RAX: 0000000000000000 RBX: 0000000000000001 RCX: 0000000000000000 [ 50.497621] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 [ 50.497621] RBP: ffffaa2400fcfcd0 R08: 0000000000000000 R09: 0000000000000000 [ 50.497622] R10: 0000000000000000 R11: 0000000000000000 R12: ffff99b2105242d8 [ 50.497622] R13: 0000000000000000 R14: ffff99b210500000 R15: ffff99b210500000 [ 50.497623] FS: 0000000000000000(0000) GS:ffff99b518480000(0000) knlGS:0000000000000000 [ 50.497623] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 50.497624] CR2: 00007f9d32aa91e8 CR3: 00000001ba210000 CR4: 0000000000750ee0 [ 50.497624] PKRU: 55555554 [ 50.497625] Call Trace: [ 50.497625] <TASK> [ 50.497627] jpeg_v4_0_hw_fini+0x43/0xc0 [amdgpu] [ 50.497693] jpeg_v4_0_suspend+0x13/0x30 [amdgpu] [ 50.497751] amdgpu_device_ip_suspend_phase2+0x240/0x470 [amdgpu] [ 50.497802] amdgpu_device_ip_suspend+0x41/0x80 [amdgpu] [ 50.497854] amdgpu_device_pre_asic_reset+0xd9/0x4a0 [amdgpu] [ 50.497905] amdgpu_device_gpu_recover.cold+0x548/0xcf1 [amdgpu] [ 50.498005] amdgpu_debugfs_reset_work+0x4c/0x80 [amdgpu] [ 50.498060] process_one_work+0x21f/0x400 [ 50.498063] worker_thread+0x200/0x3f0 [ 50.498064] ? process_one_work+0x400/0x400 [ 50.498065] kthread+0xee/0x120 [ 50.498067] ? kthread_complete_and_exit+0x20/0x20 [ 50.498068] ret_from_fork+0x22/0x30 Suggested-by: Hawking Zhang <[email protected]> Signed-off-by: Horatio Zhang <[email protected]> Reviewed-by: Tao Zhou <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 30b2d77 commit bc3e1d6

File tree

1 file changed

+21
-7
lines changed

1 file changed

+21
-7
lines changed

drivers/gpu/drm/amd/amdgpu/jpeg_v4_0.c

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,13 @@ static int jpeg_v4_0_sw_init(void *handle)
8787

8888
/* JPEG DJPEG POISON EVENT */
8989
r = amdgpu_irq_add_id(adev, SOC15_IH_CLIENTID_VCN,
90-
VCN_4_0__SRCID_DJPEG0_POISON, &adev->jpeg.inst->irq);
90+
VCN_4_0__SRCID_DJPEG0_POISON, &adev->jpeg.inst->ras_poison_irq);
9191
if (r)
9292
return r;
9393

9494
/* JPEG EJPEG POISON EVENT */
9595
r = amdgpu_irq_add_id(adev, SOC15_IH_CLIENTID_VCN,
96-
VCN_4_0__SRCID_EJPEG0_POISON, &adev->jpeg.inst->irq);
96+
VCN_4_0__SRCID_EJPEG0_POISON, &adev->jpeg.inst->ras_poison_irq);
9797
if (r)
9898
return r;
9999

@@ -202,7 +202,8 @@ static int jpeg_v4_0_hw_fini(void *handle)
202202
RREG32_SOC15(JPEG, 0, regUVD_JRBC_STATUS))
203203
jpeg_v4_0_set_powergating_state(adev, AMD_PG_STATE_GATE);
204204
}
205-
amdgpu_irq_put(adev, &adev->jpeg.inst->irq, 0);
205+
if (amdgpu_ras_is_supported(adev, AMDGPU_RAS_BLOCK__JPEG))
206+
amdgpu_irq_put(adev, &adev->jpeg.inst->ras_poison_irq, 0);
206207

207208
return 0;
208209
}
@@ -670,6 +671,14 @@ static int jpeg_v4_0_set_interrupt_state(struct amdgpu_device *adev,
670671
return 0;
671672
}
672673

674+
static int jpeg_v4_0_set_ras_interrupt_state(struct amdgpu_device *adev,
675+
struct amdgpu_irq_src *source,
676+
unsigned int type,
677+
enum amdgpu_interrupt_state state)
678+
{
679+
return 0;
680+
}
681+
673682
static int jpeg_v4_0_process_interrupt(struct amdgpu_device *adev,
674683
struct amdgpu_irq_src *source,
675684
struct amdgpu_iv_entry *entry)
@@ -680,10 +689,6 @@ static int jpeg_v4_0_process_interrupt(struct amdgpu_device *adev,
680689
case VCN_4_0__SRCID__JPEG_DECODE:
681690
amdgpu_fence_process(&adev->jpeg.inst->ring_dec);
682691
break;
683-
case VCN_4_0__SRCID_DJPEG0_POISON:
684-
case VCN_4_0__SRCID_EJPEG0_POISON:
685-
amdgpu_jpeg_process_poison_irq(adev, source, entry);
686-
break;
687692
default:
688693
DRM_DEV_ERROR(adev->dev, "Unhandled interrupt: %d %d\n",
689694
entry->src_id, entry->src_data[0]);
@@ -753,10 +758,18 @@ static const struct amdgpu_irq_src_funcs jpeg_v4_0_irq_funcs = {
753758
.process = jpeg_v4_0_process_interrupt,
754759
};
755760

761+
static const struct amdgpu_irq_src_funcs jpeg_v4_0_ras_irq_funcs = {
762+
.set = jpeg_v4_0_set_ras_interrupt_state,
763+
.process = amdgpu_jpeg_process_poison_irq,
764+
};
765+
756766
static void jpeg_v4_0_set_irq_funcs(struct amdgpu_device *adev)
757767
{
758768
adev->jpeg.inst->irq.num_types = 1;
759769
adev->jpeg.inst->irq.funcs = &jpeg_v4_0_irq_funcs;
770+
771+
adev->jpeg.inst->ras_poison_irq.num_types = 1;
772+
adev->jpeg.inst->ras_poison_irq.funcs = &jpeg_v4_0_ras_irq_funcs;
760773
}
761774

762775
const struct amdgpu_ip_block_version jpeg_v4_0_ip_block = {
@@ -811,6 +824,7 @@ const struct amdgpu_ras_block_hw_ops jpeg_v4_0_ras_hw_ops = {
811824
static struct amdgpu_jpeg_ras jpeg_v4_0_ras = {
812825
.ras_block = {
813826
.hw_ops = &jpeg_v4_0_ras_hw_ops,
827+
.ras_late_init = amdgpu_jpeg_ras_late_init,
814828
},
815829
};
816830

0 commit comments

Comments
 (0)