Skip to contentSkip to conversation

drm/amdgpu: fix amdgpu_irq_put call trace in jpeg_v4_0_hw_fini

PATCH In review Horatio Zhang 3 participants 9 messages May 8, 2023 – May 11, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 drm/amdgpu: fix amdgpu_irq_put call trace in jpeg_v4_0_hw_fini

During the suspend, the jpeg_v4_0_hw_init function will use the amdgpu_irq_put to disable the irq of jpeg.inst, but it was not enabled during the resume process, which resulted in a call trace during the GPU reset process.

[   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
Fixes 86e8255f941e ("drm/amdgpu: add JPEG 4.0 RAS poison consumption handling")
---
 drivers/gpu/drm/amd/amdgpu/jpeg_v4_0.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/jpeg_v4_0.c +8 -1
index 77e1e64aa1d1..b5c14a166063 100644
@@ -66,6 +66,13 @@ static int jpeg_v4_0_early_init(void *handle)
 	return 0;
 }
 
+static int jpeg_v4_0_late_init(void *handle)
+{
+	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+
+	return amdgpu_irq_get(adev, &adev->jpeg.inst->irq, 0);
+}
+
 /**
  * jpeg_v4_0_sw_init - sw init for JPEG block
  *
@@ -696,7 +703,7 @@ static int jpeg_v4_0_process_interrupt(struct amdgpu_device *adev,
 static const struct amd_ip_funcs jpeg_v4_0_ip_funcs = {
 	.name = "jpeg_v4_0",
 	.early_init = jpeg_v4_0_early_init,
-	.late_init = NULL,
+	.late_init = jpeg_v4_0_late_init,
 	.sw_init = jpeg_v4_0_sw_init,
 	.sw_fini = jpeg_v4_0_sw_fini,
 	.hw_init = jpeg_v4_0_hw_init,
Signature · 1 line
2.34.1
#1 lore raw

PATCH 2/2 drm/amdgpu: fix amdgpu_irq_put call trace in vcn_v4_0_hw_fini

During the suspend, the vcn_v4_0_hw_init function will use the amdgpu_irq_put to disable the irq of vcn.inst, but it was not enabled during the resume process, which resulted in a call trace during the GPU reset process.

[   44.563572] RIP: 0010:amdgpu_irq_put+0xa4/0xc0 [amdgpu]
[   44.563629] RSP: 0018:ffffb36740edfc90 EFLAGS: 00010246
[   44.563630] RAX: 0000000000000000 RBX: 0000000000000001 RCX: 0000000000000000
[   44.563630] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
[   44.563631] RBP: ffffb36740edfcb0 R08: 0000000000000000 R09: 0000000000000000
[   44.563631] R10: 0000000000000000 R11: 0000000000000000 R12: ffff954c568e2ea8
[   44.563631] R13: 0000000000000000 R14: ffff954c568c0000 R15: ffff954c568e2ea8
[   44.563632] FS:  0000000000000000(0000) GS:ffff954f584c0000(0000) knlGS:0000000000000000
[   44.563632] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   44.563633] CR2: 00007f028741ba70 CR3: 000000026ca10000 CR4: 0000000000750ee0
[   44.563633] PKRU: 55555554
[   44.563633] Call Trace:
[   44.563634]  <TASK>
[   44.563634]  vcn_v4_0_hw_fini+0x62/0x160 [amdgpu]
[   44.563700]  vcn_v4_0_suspend+0x13/0x30 [amdgpu]
[   44.563755]  amdgpu_device_ip_suspend_phase2+0x240/0x470 [amdgpu]
[   44.563806]  amdgpu_device_ip_suspend+0x41/0x80 [amdgpu]
[   44.563858]  amdgpu_device_pre_asic_reset+0xd9/0x4a0 [amdgpu]
[   44.563909]  amdgpu_device_gpu_recover.cold+0x548/0xcf1 [amdgpu]
[   44.564006]  amdgpu_debugfs_reset_work+0x4c/0x80 [amdgpu]
[   44.564061]  process_one_work+0x21f/0x400
[   44.564062]  worker_thread+0x200/0x3f0
[   44.564063]  ? process_one_work+0x400/0x400
[   44.564064]  kthread+0xee/0x120
[   44.564065]  ? kthread_complete_and_exit+0x20/0x20
[   44.564066]  ret_from_fork+0x22/0x30
Fixes ea5309de7388 ("drm/amdgpu: add VCN 4.0 RAS poison consumption handling")
---
 drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c +16 -1
index bf0674039598..b55eb1bf3e30 100644
@@ -281,6 +281,21 @@ static int vcn_v4_0_hw_init(void *handle)
 	return r;
 }
 
+static int vcn_v4_0_late_init(void *handle)
+{
+	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+	int i;
+
+	for (i = 0; i < adev->vcn.num_vcn_inst; ++i) {
+		if (adev->vcn.harvest_config & (1 << i))
+			continue;
+
+		amdgpu_irq_get(adev, &adev->vcn.inst[i].irq, 0);
+	}
+
+	return 0;
+}
+
 /**
  * vcn_v4_0_hw_fini - stop the hardware block
  *
@@ -2047,7 +2062,7 @@ static void vcn_v4_0_set_irq_funcs(struct amdgpu_device *adev)
 static const struct amd_ip_funcs vcn_v4_0_ip_funcs = {
 	.name = "vcn_v4_0",
 	.early_init = vcn_v4_0_early_init,
-	.late_init = NULL,
+	.late_init = vcn_v4_0_late_init,
 	.sw_init = vcn_v4_0_sw_init,
 	.sw_fini = vcn_v4_0_sw_fini,
 	.hw_init = vcn_v4_0_hw_init,
Signature · 1 line
2.34.1
#2 lore raw

RE: [PATCH 2/2] drm/amdgpu: fix amdgpu_irq_put call trace in vcn_v4_0_hw_fini

[AMD Official Use Only - General]

Quoted 66 lines

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Horatio Zhang
Sent: Monday, May 8, 2023 6:20 PM
To: [email protected]
Cc: Liu, HaoPing (Alan) <[email protected]>; Zhang, Horatio <[email protected]>; Xu, Feifei <[email protected]>; Zhou1, Tao <[email protected]>; Jiang, Sonny <[email protected]>; Limonciello, Mario <[email protected]>; Liu, Leo <[email protected]>; Zhang, Hawking <[email protected]>
Subject: [PATCH 2/2] drm/amdgpu: fix amdgpu_irq_put call trace in vcn_v4_0_hw_fini

During the suspend, the vcn_v4_0_hw_init function will use the amdgpu_irq_put to disable the irq of vcn.inst, but it was not enabled during the resume process, which resulted in a call trace during the GPU reset process.

[   44.563572] RIP: 0010:amdgpu_irq_put+0xa4/0xc0 [amdgpu]
[   44.563629] RSP: 0018:ffffb36740edfc90 EFLAGS: 00010246
[   44.563630] RAX: 0000000000000000 RBX: 0000000000000001 RCX:
0000000000000000
[   44.563630] RDX: 0000000000000000 RSI: 0000000000000000 RDI:
0000000000000000
[   44.563631] RBP: ffffb36740edfcb0 R08: 0000000000000000 R09:
0000000000000000
[   44.563631] R10: 0000000000000000 R11: 0000000000000000 R12:
ffff954c568e2ea8
[   44.563631] R13: 0000000000000000 R14: ffff954c568c0000 R15:
ffff954c568e2ea8
[   44.563632] FS:  0000000000000000(0000) GS:ffff954f584c0000(0000)
knlGS:0000000000000000
[   44.563632] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   44.563633] CR2: 00007f028741ba70 CR3: 000000026ca10000 CR4:
0000000000750ee0
[   44.563633] PKRU: 55555554
[   44.563633] Call Trace:
[   44.563634]  <TASK>
[   44.563634]  vcn_v4_0_hw_fini+0x62/0x160 [amdgpu]
[   44.563700]  vcn_v4_0_suspend+0x13/0x30 [amdgpu]
[   44.563755]  amdgpu_device_ip_suspend_phase2+0x240/0x470 [amdgpu]
[   44.563806]  amdgpu_device_ip_suspend+0x41/0x80 [amdgpu]
[   44.563858]  amdgpu_device_pre_asic_reset+0xd9/0x4a0 [amdgpu]
[   44.563909]  amdgpu_device_gpu_recover.cold+0x548/0xcf1 [amdgpu]
[   44.564006]  amdgpu_debugfs_reset_work+0x4c/0x80 [amdgpu]
[   44.564061]  process_one_work+0x21f/0x400
[   44.564062]  worker_thread+0x200/0x3f0
[   44.564063]  ? process_one_work+0x400/0x400
[   44.564064]  kthread+0xee/0x120
[   44.564065]  ? kthread_complete_and_exit+0x20/0x20
[   44.564066]  ret_from_fork+0x22/0x30
Fixes ea5309de7388 ("drm/amdgpu: add VCN 4.0 RAS poison consumption

handling")

---
 drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c +0 -0
index bf0674039598..b55eb1bf3e30 100644
@@ -281,6 +281,21 @@ static int vcn_v4_0_hw_init(void *handle)
 	return r;
 }

drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c static int vcn_v4_0_hw_init(void *handle) · line 292

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c +9 -0
 
+static int vcn_v4_0_late_init(void *handle) {
+	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+	int i;
+
+	for (i = 0; i < adev->vcn.num_vcn_inst; ++i) {
+		if (adev->vcn.harvest_config & (1 << i))
+			continue;
+
+		amdgpu_irq_get(adev, &adev->vcn.inst[i].irq, 0);

[Tao] we can also check its return value and exit if the r is none-zero. But either way is fine with me.

Quoted 19 lines
drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c +6 -2
+	}
+
+	return 0;
+}
+
 /**
  * vcn_v4_0_hw_fini - stop the hardware block
  *
@@ -2047,7 +2062,7 @@ static void vcn_v4_0_set_irq_funcs(struct
 amdgpu_device *adev)  static const struct amd_ip_funcs vcn_v4_0_ip_funcs = {
 	.name = "vcn_v4_0",
 	.early_init = vcn_v4_0_early_init,
-	.late_init = NULL,
+	.late_init = vcn_v4_0_late_init,
 	.sw_init = vcn_v4_0_sw_init,
 	.sw_fini = vcn_v4_0_sw_fini,
 	.hw_init = vcn_v4_0_hw_init,
--

2.34.1

#3 lore raw

RE: [PATCH 2/2] drm/amdgpu: fix amdgpu_irq_put call trace in vcn_v4_0_hw_fini

[AMD Official Use Only - General]

Hi Tao,

Sorry, I forgot to check, thank you for your suggestion. I will update this modification in the next version.

Thanks,
Horatio

-----Original Message-----
From: Zhou1, Tao <[email protected]>
Sent: Monday, May 8, 2023 7:05 PM
To: Zhang, Horatio <[email protected]>; [email protected]
Cc: Liu, HaoPing (Alan) <[email protected]>; Zhang, Horatio <[email protected]>; Xu, Feifei <[email protected]>; Jiang, Sonny <[email protected]>; Limonciello, Mario <[email protected]>; Liu, Leo <[email protected]>; Zhang, Hawking <[email protected]>
Subject: RE: [PATCH 2/2] drm/amdgpu: fix amdgpu_irq_put call trace in vcn_v4_0_hw_fini

[AMD Official Use Only - General]

Quoted 66 lines

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Horatio Zhang
Sent: Monday, May 8, 2023 6:20 PM
To: [email protected]
Cc: Liu, HaoPing (Alan) <[email protected]>; Zhang, Horatio <[email protected]>; Xu, Feifei <[email protected]>; Zhou1, Tao <[email protected]>; Jiang, Sonny <[email protected]>; Limonciello, Mario <[email protected]>; Liu, Leo <[email protected]>; Zhang, Hawking <[email protected]>
Subject: [PATCH 2/2] drm/amdgpu: fix amdgpu_irq_put call trace in vcn_v4_0_hw_fini

During the suspend, the vcn_v4_0_hw_init function will use the amdgpu_irq_put to disable the irq of vcn.inst, but it was not enabled during the resume process, which resulted in a call trace during the GPU reset process.

[   44.563572] RIP: 0010:amdgpu_irq_put+0xa4/0xc0 [amdgpu]
[   44.563629] RSP: 0018:ffffb36740edfc90 EFLAGS: 00010246
[   44.563630] RAX: 0000000000000000 RBX: 0000000000000001 RCX:
0000000000000000
[   44.563630] RDX: 0000000000000000 RSI: 0000000000000000 RDI:
0000000000000000
[   44.563631] RBP: ffffb36740edfcb0 R08: 0000000000000000 R09:
0000000000000000
[   44.563631] R10: 0000000000000000 R11: 0000000000000000 R12:
ffff954c568e2ea8
[   44.563631] R13: 0000000000000000 R14: ffff954c568c0000 R15:
ffff954c568e2ea8
[   44.563632] FS:  0000000000000000(0000) GS:ffff954f584c0000(0000)
knlGS:0000000000000000
[   44.563632] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   44.563633] CR2: 00007f028741ba70 CR3: 000000026ca10000 CR4:
0000000000750ee0
[   44.563633] PKRU: 55555554
[   44.563633] Call Trace:
[   44.563634]  <TASK>
[   44.563634]  vcn_v4_0_hw_fini+0x62/0x160 [amdgpu]
[   44.563700]  vcn_v4_0_suspend+0x13/0x30 [amdgpu]
[   44.563755]  amdgpu_device_ip_suspend_phase2+0x240/0x470 [amdgpu]
[   44.563806]  amdgpu_device_ip_suspend+0x41/0x80 [amdgpu]
[   44.563858]  amdgpu_device_pre_asic_reset+0xd9/0x4a0 [amdgpu]
[   44.563909]  amdgpu_device_gpu_recover.cold+0x548/0xcf1 [amdgpu]
[   44.564006]  amdgpu_debugfs_reset_work+0x4c/0x80 [amdgpu]
[   44.564061]  process_one_work+0x21f/0x400
[   44.564062]  worker_thread+0x200/0x3f0
[   44.564063]  ? process_one_work+0x400/0x400
[   44.564064]  kthread+0xee/0x120
[   44.564065]  ? kthread_complete_and_exit+0x20/0x20
[   44.564066]  ret_from_fork+0x22/0x30
Fixes ea5309de7388 ("drm/amdgpu: add VCN 4.0 RAS poison consumption

handling")

---
 drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c +0 -0
index bf0674039598..b55eb1bf3e30 100644
@@ -281,6 +281,21 @@ static int vcn_v4_0_hw_init(void *handle)
 	return r;
 }

drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c static int vcn_v4_0_hw_init(void *handle) · line 292

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c +9 -0
 
+static int vcn_v4_0_late_init(void *handle) {
+	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+	int i;
+
+	for (i = 0; i < adev->vcn.num_vcn_inst; ++i) {
+		if (adev->vcn.harvest_config & (1 << i))
+			continue;
+
+		amdgpu_irq_get(adev, &adev->vcn.inst[i].irq, 0);

[Tao] we can also check its return value and exit if the r is none-zero. But either way is fine with me.

Quoted 19 lines
drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c +6 -2
+	}
+
+	return 0;
+}
+
 /**
  * vcn_v4_0_hw_fini - stop the hardware block
  *
@@ -2047,7 +2062,7 @@ static void vcn_v4_0_set_irq_funcs(struct 
 amdgpu_device *adev)  static const struct amd_ip_funcs vcn_v4_0_ip_funcs = {
 	.name = "vcn_v4_0",
 	.early_init = vcn_v4_0_early_init,
-	.late_init = NULL,
+	.late_init = vcn_v4_0_late_init,
 	.sw_init = vcn_v4_0_sw_init,
 	.sw_fini = vcn_v4_0_sw_fini,
 	.hw_init = vcn_v4_0_hw_init,
--

2.34.1

Reviewed-by on v1 1/2
#4 lore raw
In reply to Horatio Zhang

[AMD Official Use Only - General]

The series is:

Quoted 85 lines

-----Original Message-----
From: Horatio Zhang <[email protected]>
Sent: Monday, May 8, 2023 6:20 PM
To: [email protected]
Cc: Zhang, Hawking <[email protected]>; Zhou1, Tao <[email protected]>; Xu, Feifei <[email protected]>; Liu, Leo <[email protected]>; Jiang, Sonny <[email protected]>; Limonciello, Mario <[email protected]>; Liu, HaoPing (Alan) <[email protected]>; Zhang, Horatio <[email protected]>
Subject: [PATCH 1/2] drm/amdgpu: fix amdgpu_irq_put call trace in jpeg_v4_0_hw_fini

During the suspend, the jpeg_v4_0_hw_init function will use the amdgpu_irq_put to disable the irq of jpeg.inst, but it was not enabled during the resume process, which resulted in a call trace during the GPU reset process.

[   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
Fixes 86e8255f941e ("drm/amdgpu: add JPEG 4.0 RAS poison consumption

handling")

---
 drivers/gpu/drm/amd/amdgpu/jpeg_v4_0.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/jpeg_v4_0.c +6 -2
index 77e1e64aa1d1..b5c14a166063 100644
@@ -66,6 +66,13 @@ static int jpeg_v4_0_early_init(void *handle)
 	return 0;
 }
 
+static int jpeg_v4_0_late_init(void *handle) {
+	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+
+	return amdgpu_irq_get(adev, &adev->jpeg.inst->irq, 0); }
+
 /**
  * jpeg_v4_0_sw_init - sw init for JPEG block
  *
@@ -696,7 +703,7 @@ static int jpeg_v4_0_process_interrupt(struct
 amdgpu_device *adev,  static const struct amd_ip_funcs jpeg_v4_0_ip_funcs = {
 	.name = "jpeg_v4_0",
 	.early_init = jpeg_v4_0_early_init,
-	.late_init = NULL,
+	.late_init = jpeg_v4_0_late_init,
 	.sw_init = jpeg_v4_0_sw_init,
 	.sw_fini = jpeg_v4_0_sw_fini,
 	.hw_init = jpeg_v4_0_hw_init,
--

2.34.1

Reviewed-by Tao Zhou
#5 lore raw

[AMD Official Use Only - General]

Shall we consider creating amdgpu_vcn_ras_late_init as a common helper for interrupt enablement, like other IP blocks. This also reduces further effort when RAS feature is introduced in new version of vcn/jpeg

Regards,
Hawking

-----Original Message-----
From: Zhou1, Tao <[email protected]>
Sent: Monday, May 8, 2023 19:06
To: Zhang, Horatio <[email protected]>; [email protected]
Cc: Zhang, Hawking <[email protected]>; Xu, Feifei <[email protected]>; Liu, Leo <[email protected]>; Jiang, Sonny <[email protected]>; Limonciello, Mario <[email protected]>; Liu, HaoPing (Alan) <[email protected]>; Zhang, Horatio <[email protected]>
Subject: RE: [PATCH 1/2] drm/amdgpu: fix amdgpu_irq_put call trace in jpeg_v4_0_hw_fini

[AMD Official Use Only - General]

The series is:

Quoted 85 lines

-----Original Message-----
From: Horatio Zhang <[email protected]>
Sent: Monday, May 8, 2023 6:20 PM
To: [email protected]
Cc: Zhang, Hawking <[email protected]>; Zhou1, Tao <[email protected]>; Xu, Feifei <[email protected]>; Liu, Leo <[email protected]>; Jiang, Sonny <[email protected]>; Limonciello, Mario <[email protected]>; Liu, HaoPing (Alan) <[email protected]>; Zhang, Horatio <[email protected]>
Subject: [PATCH 1/2] drm/amdgpu: fix amdgpu_irq_put call trace in jpeg_v4_0_hw_fini

During the suspend, the jpeg_v4_0_hw_init function will use the amdgpu_irq_put to disable the irq of jpeg.inst, but it was not enabled during the resume process, which resulted in a call trace during the GPU reset process.

[   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
Fixes 86e8255f941e ("drm/amdgpu: add JPEG 4.0 RAS poison consumption

handling")

---
 drivers/gpu/drm/amd/amdgpu/jpeg_v4_0.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/jpeg_v4_0.c +6 -2
index 77e1e64aa1d1..b5c14a166063 100644
@@ -66,6 +66,13 @@ static int jpeg_v4_0_early_init(void *handle)
 	return 0;
 }
 
+static int jpeg_v4_0_late_init(void *handle) {
+	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+
+	return amdgpu_irq_get(adev, &adev->jpeg.inst->irq, 0); }
+
 /**
  * jpeg_v4_0_sw_init - sw init for JPEG block
  *
@@ -696,7 +703,7 @@ static int jpeg_v4_0_process_interrupt(struct
 amdgpu_device *adev,  static const struct amd_ip_funcs jpeg_v4_0_ip_funcs = {
 	.name = "jpeg_v4_0",
 	.early_init = jpeg_v4_0_early_init,
-	.late_init = NULL,
+	.late_init = jpeg_v4_0_late_init,
 	.sw_init = jpeg_v4_0_sw_init,
 	.sw_fini = jpeg_v4_0_sw_fini,
 	.hw_init = jpeg_v4_0_hw_init,
--

2.34.1

author Reviewed-by Tao Zhou
#6 lore raw

[AMD Official Use Only - General]

Hi Hawking,

When modprobe, the interrupt of jpeg/vcn was enabled in amdgpu_fence_driver_hw_init(). If the amdgpu_irq_get function is added in amdgpu_xxx_ras_late_init/xxx_v4_0_late_init, it will enable the instance interrupt twice. My previous modification plan also had this issue. Perhaps we should remove the amdgpu_irq_put function from jpeg/vcn_v4_0_hw_fini.

Regards,
Horatio

-----Original Message-----
From: Zhang, Hawking <[email protected]>
Sent: Monday, May 8, 2023 8:32 PM
To: Zhou1, Tao <[email protected]>; Zhang, Horatio <[email protected]>; [email protected]
Cc: Xu, Feifei <[email protected]>; Liu, Leo <[email protected]>; Jiang, Sonny <[email protected]>; Limonciello, Mario <[email protected]>; Liu, HaoPing (Alan) <[email protected]>; Zhang, Horatio <[email protected]>
Subject: RE: [PATCH 1/2] drm/amdgpu: fix amdgpu_irq_put call trace in jpeg_v4_0_hw_fini

[AMD Official Use Only - General]

Shall we consider creating amdgpu_vcn_ras_late_init as a common helper for interrupt enablement, like other IP blocks. This also reduces further effort when RAS feature is introduced in new version of vcn/jpeg

Regards,
Hawking

-----Original Message-----
From: Zhou1, Tao <[email protected]>
Sent: Monday, May 8, 2023 19:06
To: Zhang, Horatio <[email protected]>; [email protected]
Cc: Zhang, Hawking <[email protected]>; Xu, Feifei <[email protected]>; Liu, Leo <[email protected]>; Jiang, Sonny <[email protected]>; Limonciello, Mario <[email protected]>; Liu, HaoPing (Alan) <[email protected]>; Zhang, Horatio <[email protected]>
Subject: RE: [PATCH 1/2] drm/amdgpu: fix amdgpu_irq_put call trace in jpeg_v4_0_hw_fini

[AMD Official Use Only - General]

The series is:

Quoted 85 lines

-----Original Message-----
From: Horatio Zhang <[email protected]>
Sent: Monday, May 8, 2023 6:20 PM
To: [email protected]
Cc: Zhang, Hawking <[email protected]>; Zhou1, Tao <[email protected]>; Xu, Feifei <[email protected]>; Liu, Leo <[email protected]>; Jiang, Sonny <[email protected]>; Limonciello, Mario <[email protected]>; Liu, HaoPing (Alan) <[email protected]>; Zhang, Horatio <[email protected]>
Subject: [PATCH 1/2] drm/amdgpu: fix amdgpu_irq_put call trace in jpeg_v4_0_hw_fini

During the suspend, the jpeg_v4_0_hw_init function will use the amdgpu_irq_put to disable the irq of jpeg.inst, but it was not enabled during the resume process, which resulted in a call trace during the GPU reset process.

[   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
Fixes 86e8255f941e ("drm/amdgpu: add JPEG 4.0 RAS poison consumption

handling")

---
 drivers/gpu/drm/amd/amdgpu/jpeg_v4_0.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/jpeg_v4_0.c +6 -2
index 77e1e64aa1d1..b5c14a166063 100644
@@ -66,6 +66,13 @@ static int jpeg_v4_0_early_init(void *handle)
 	return 0;
 }
 
+static int jpeg_v4_0_late_init(void *handle) {
+	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+
+	return amdgpu_irq_get(adev, &adev->jpeg.inst->irq, 0); }
+
 /**
  * jpeg_v4_0_sw_init - sw init for JPEG block
  *
@@ -696,7 +703,7 @@ static int jpeg_v4_0_process_interrupt(struct
 amdgpu_device *adev,  static const struct amd_ip_funcs jpeg_v4_0_ip_funcs = {
 	.name = "jpeg_v4_0",
 	.early_init = jpeg_v4_0_early_init,
-	.late_init = NULL,
+	.late_init = jpeg_v4_0_late_init,
 	.sw_init = jpeg_v4_0_sw_init,
 	.sw_fini = jpeg_v4_0_sw_fini,
 	.hw_init = jpeg_v4_0_hw_init,
--

2.34.1

Reviewed-by Tao Zhou
#7 lore raw

[AMD Official Use Only - General]

Please register dedicated ras_irq src and funcs for UVD_POISON, which should allow you to create vcn ras sw calls like gfx/sdma ip block.

Regards,
Hawking

-----Original Message-----
From: Zhang, Horatio <[email protected]>
Sent: Wednesday, May 10, 2023 18:55
To: Zhang, Hawking <[email protected]>; Zhou1, Tao <[email protected]>; [email protected]
Cc: Xu, Feifei <[email protected]>; Liu, Leo <[email protected]>; Jiang, Sonny <[email protected]>; Limonciello, Mario <[email protected]>; Liu, HaoPing (Alan) <[email protected]>; Zhou, Bob <[email protected]>
Subject: RE: [PATCH 1/2] drm/amdgpu: fix amdgpu_irq_put call trace in jpeg_v4_0_hw_fini

[AMD Official Use Only - General]

Hi Hawking,

When modprobe, the interrupt of jpeg/vcn was enabled in amdgpu_fence_driver_hw_init(). If the amdgpu_irq_get function is added in amdgpu_xxx_ras_late_init/xxx_v4_0_late_init, it will enable the instance interrupt twice. My previous modification plan also had this issue. Perhaps we should remove the amdgpu_irq_put function from jpeg/vcn_v4_0_hw_fini.

Regards,
Horatio

-----Original Message-----
From: Zhang, Hawking <[email protected]>
Sent: Monday, May 8, 2023 8:32 PM
To: Zhou1, Tao <[email protected]>; Zhang, Horatio <[email protected]>; [email protected]
Cc: Xu, Feifei <[email protected]>; Liu, Leo <[email protected]>; Jiang, Sonny <[email protected]>; Limonciello, Mario <[email protected]>; Liu, HaoPing (Alan) <[email protected]>; Zhang, Horatio <[email protected]>
Subject: RE: [PATCH 1/2] drm/amdgpu: fix amdgpu_irq_put call trace in jpeg_v4_0_hw_fini

[AMD Official Use Only - General]

Shall we consider creating amdgpu_vcn_ras_late_init as a common helper for interrupt enablement, like other IP blocks. This also reduces further effort when RAS feature is introduced in new version of vcn/jpeg

Regards,
Hawking

-----Original Message-----
From: Zhou1, Tao <[email protected]>
Sent: Monday, May 8, 2023 19:06
To: Zhang, Horatio <[email protected]>; [email protected]
Cc: Zhang, Hawking <[email protected]>; Xu, Feifei <[email protected]>; Liu, Leo <[email protected]>; Jiang, Sonny <[email protected]>; Limonciello, Mario <[email protected]>; Liu, HaoPing (Alan) <[email protected]>; Zhang, Horatio <[email protected]>
Subject: RE: [PATCH 1/2] drm/amdgpu: fix amdgpu_irq_put call trace in jpeg_v4_0_hw_fini

[AMD Official Use Only - General]

The series is:

Quoted 85 lines

-----Original Message-----
From: Horatio Zhang <[email protected]>
Sent: Monday, May 8, 2023 6:20 PM
To: [email protected]
Cc: Zhang, Hawking <[email protected]>; Zhou1, Tao <[email protected]>; Xu, Feifei <[email protected]>; Liu, Leo <[email protected]>; Jiang, Sonny <[email protected]>; Limonciello, Mario <[email protected]>; Liu, HaoPing (Alan) <[email protected]>; Zhang, Horatio <[email protected]>
Subject: [PATCH 1/2] drm/amdgpu: fix amdgpu_irq_put call trace in jpeg_v4_0_hw_fini

During the suspend, the jpeg_v4_0_hw_init function will use the amdgpu_irq_put to disable the irq of jpeg.inst, but it was not enabled during the resume process, which resulted in a call trace during the GPU reset process.

[   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
Fixes 86e8255f941e ("drm/amdgpu: add JPEG 4.0 RAS poison consumption

handling")

---
 drivers/gpu/drm/amd/amdgpu/jpeg_v4_0.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/jpeg_v4_0.c +6 -2
index 77e1e64aa1d1..b5c14a166063 100644
@@ -66,6 +66,13 @@ static int jpeg_v4_0_early_init(void *handle)
 	return 0;
 }
 
+static int jpeg_v4_0_late_init(void *handle) {
+	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+
+	return amdgpu_irq_get(adev, &adev->jpeg.inst->irq, 0); }
+
 /**
  * jpeg_v4_0_sw_init - sw init for JPEG block
  *
@@ -696,7 +703,7 @@ static int jpeg_v4_0_process_interrupt(struct
 amdgpu_device *adev,  static const struct amd_ip_funcs jpeg_v4_0_ip_funcs = {
 	.name = "jpeg_v4_0",
 	.early_init = jpeg_v4_0_early_init,
-	.late_init = NULL,
+	.late_init = jpeg_v4_0_late_init,
 	.sw_init = jpeg_v4_0_sw_init,
 	.sw_fini = jpeg_v4_0_sw_fini,
 	.hw_init = jpeg_v4_0_hw_init,
--

2.34.1

author Reviewed-by Tao Zhou
#8 lore raw

[AMD Official Use Only - General]

Got it!

Thanks,
Horatio

-----Original Message-----
From: Zhang, Hawking <[email protected]>
Sent: Thursday, May 11, 2023 10:28 AM
To: Zhang, Horatio <[email protected]>; Zhou1, Tao <[email protected]>; [email protected]
Cc: Xu, Feifei <[email protected]>; Liu, Leo <[email protected]>; Jiang, Sonny <[email protected]>; Limonciello, Mario <[email protected]>; Liu, HaoPing (Alan) <[email protected]>; Zhou, Bob <[email protected]>
Subject: RE: [PATCH 1/2] drm/amdgpu: fix amdgpu_irq_put call trace in jpeg_v4_0_hw_fini

[AMD Official Use Only - General]

Please register dedicated ras_irq src and funcs for UVD_POISON, which should allow you to create vcn ras sw calls like gfx/sdma ip block.

Regards,
Hawking

-----Original Message-----
From: Zhang, Horatio <[email protected]>
Sent: Wednesday, May 10, 2023 18:55
To: Zhang, Hawking <[email protected]>; Zhou1, Tao <[email protected]>; [email protected]
Cc: Xu, Feifei <[email protected]>; Liu, Leo <[email protected]>; Jiang, Sonny <[email protected]>; Limonciello, Mario <[email protected]>; Liu, HaoPing (Alan) <[email protected]>; Zhou, Bob <[email protected]>
Subject: RE: [PATCH 1/2] drm/amdgpu: fix amdgpu_irq_put call trace in jpeg_v4_0_hw_fini

[AMD Official Use Only - General]

Hi Hawking,

When modprobe, the interrupt of jpeg/vcn was enabled in amdgpu_fence_driver_hw_init(). If the amdgpu_irq_get function is added in amdgpu_xxx_ras_late_init/xxx_v4_0_late_init, it will enable the instance interrupt twice. My previous modification plan also had this issue. Perhaps we should remove the amdgpu_irq_put function from jpeg/vcn_v4_0_hw_fini.

Regards,
Horatio

-----Original Message-----
From: Zhang, Hawking <[email protected]>
Sent: Monday, May 8, 2023 8:32 PM
To: Zhou1, Tao <[email protected]>; Zhang, Horatio <[email protected]>; [email protected]
Cc: Xu, Feifei <[email protected]>; Liu, Leo <[email protected]>; Jiang, Sonny <[email protected]>; Limonciello, Mario <[email protected]>; Liu, HaoPing (Alan) <[email protected]>; Zhang, Horatio <[email protected]>
Subject: RE: [PATCH 1/2] drm/amdgpu: fix amdgpu_irq_put call trace in jpeg_v4_0_hw_fini

[AMD Official Use Only - General]

Shall we consider creating amdgpu_vcn_ras_late_init as a common helper for interrupt enablement, like other IP blocks. This also reduces further effort when RAS feature is introduced in new version of vcn/jpeg

Regards,
Hawking

-----Original Message-----
From: Zhou1, Tao <[email protected]>
Sent: Monday, May 8, 2023 19:06
To: Zhang, Horatio <[email protected]>; [email protected]
Cc: Zhang, Hawking <[email protected]>; Xu, Feifei <[email protected]>; Liu, Leo <[email protected]>; Jiang, Sonny <[email protected]>; Limonciello, Mario <[email protected]>; Liu, HaoPing (Alan) <[email protected]>; Zhang, Horatio <[email protected]>
Subject: RE: [PATCH 1/2] drm/amdgpu: fix amdgpu_irq_put call trace in jpeg_v4_0_hw_fini

[AMD Official Use Only - General]

The series is:

Quoted 85 lines

-----Original Message-----
From: Horatio Zhang <[email protected]>
Sent: Monday, May 8, 2023 6:20 PM
To: [email protected]
Cc: Zhang, Hawking <[email protected]>; Zhou1, Tao <[email protected]>; Xu, Feifei <[email protected]>; Liu, Leo <[email protected]>; Jiang, Sonny <[email protected]>; Limonciello, Mario <[email protected]>; Liu, HaoPing (Alan) <[email protected]>; Zhang, Horatio <[email protected]>
Subject: [PATCH 1/2] drm/amdgpu: fix amdgpu_irq_put call trace in jpeg_v4_0_hw_fini

During the suspend, the jpeg_v4_0_hw_init function will use the amdgpu_irq_put to disable the irq of jpeg.inst, but it was not enabled during the resume process, which resulted in a call trace during the GPU reset process.

[   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
Fixes 86e8255f941e ("drm/amdgpu: add JPEG 4.0 RAS poison consumption

handling")

---
 drivers/gpu/drm/amd/amdgpu/jpeg_v4_0.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/jpeg_v4_0.c +6 -2
index 77e1e64aa1d1..b5c14a166063 100644
@@ -66,6 +66,13 @@ static int jpeg_v4_0_early_init(void *handle)
 	return 0;
 }
 
+static int jpeg_v4_0_late_init(void *handle) {
+	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+
+	return amdgpu_irq_get(adev, &adev->jpeg.inst->irq, 0); }
+
 /**
  * jpeg_v4_0_sw_init - sw init for JPEG block
  *
@@ -696,7 +703,7 @@ static int jpeg_v4_0_process_interrupt(struct
 amdgpu_device *adev,  static const struct amd_ip_funcs jpeg_v4_0_ip_funcs = {
 	.name = "jpeg_v4_0",
 	.early_init = jpeg_v4_0_early_init,
-	.late_init = NULL,
+	.late_init = jpeg_v4_0_late_init,
 	.sw_init = jpeg_v4_0_sw_init,
 	.sw_fini = jpeg_v4_0_sw_fini,
 	.hw_init = jpeg_v4_0_hw_init,
--

2.34.1