drm/amdgpu: guard VCE/UVD sched entity teardown on failed probe
Subsystems (2)
PATCH v2 1/1 drm/amdgpu: guard VCE/UVD sched entity teardown on failed probe
Since commit 037b98a2312e ("drm/amdgpu: move UVD and VCE sched entity init after sched init"), drm_sched_entity_init() for the VCE and UVD kernel entities runs in the scheduler-init phase, well after the IP-block sw_init phase has allocated the vcpu_bos.
If probe fails between the two phases, amdgpu_device_fini_sw() still runs the per-IP sw_fini callbacks for blocks that did complete sw_init. Both amdgpu_vce_sw_fini() and amdgpu_uvd_sw_fini() then call drm_sched_entity_destroy() on an entity that was never initialized:entity->rq is NULL and drm_sched_entity_flush() dereferences it, oopsing in whatever context drove the failed probe.
The hole was latent-but-safe until commit 2df5efb45425 ("drm/sched:
Remove redundant entity->rq initialization and checks") removed the if (!entity->rq) early return that commit 1decbf6bb0b4 ("drm/sched:
Fix entities with 0 rqs.") had put in drm_sched_entity_flush(), on the grounds that entity->rq can never be NULL. That holds only for entities that completed drm_sched_entity_init() — not for the never-initialized entity this teardown path reaches.
Observed on real hardware: MI50 (Vega20, VCE 4.0 / UVD 7.2) behind a Thunderbolt link — a pciehp presence/link-change event re-probes the device; when the re-probe fails (-EINVAL here), the cleanup path NULL-derefs inside drm_sched_entity_flush() in the pciehp IRQ thread and takes the whole machine down (panic_on_oops, EFI pstore capture). Reproduced twice on 7.3-rc5, 2026-10-06 and 2026-10-09, identical signature; the faulting instruction is mov (%rax),%r15 on rax = entity->rq == NULL, i.e. sched = entity->rq->sched:
BUG: kernel NULL pointer dereference RIP: drm_sched_entity_flush+0x34/0x2d0 [gpu_sched] drm_sched_entity_destroy amdgpu_vce_sw_fini vce_v4_0_sw_fini amdgpu_device_fini_sw ... pciehp_configure_device pciehp_handle_presence_or_link_change
Guard the entity teardown on entity->rq, which is set only by drm_sched_entity_init(). amdgpu_ring_fini() already self-guards via the rings[] registration, and the vcpu_bo/firmware cleanup still runs as before.
v2: retarget Fixes: at commit 2df5efb45425 ("drm/sched: Remove redundant entity->rq initialization and checks") — the !entity->rq check from commit 1decbf6bb0b4 ("drm/sched: Fix entities with 0 rqs.") that Alex pointed to was removed by it in the 7.3 window, so this is a regression there, not a pre-existing hole.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 3 ++- drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c +2 -1
@@ -377,7 +377,8 @@ int amdgpu_uvd_sw_fini(struct amdgpu_device *adev)void *addr =amdgpu_bo_kptr (adev->uvd.ib_bo);int i, j; -drm_sched_entity_destroy (&adev->uvd.entity); +if (adev->uvd.entity.rq) +drm_sched_entity_destroy (&adev->uvd.entity);for (j =0 ; j < adev->uvd.num_uvd_inst; ++j) {if (adev->uvd.harvest_config & (1 << j))
drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c +2 -1
@@ -253,7 +253,8 @@ int amdgpu_vce_sw_fini(struct amdgpu_device *adev)if (adev->vce.vcpu_bo ==NULL )return 0 ; -drm_sched_entity_destroy (&adev->vce.entity); +if (adev->vce.entity.rq) +drm_sched_entity_destroy (&adev->vce.entity);for (i =0 ; i < adev->vce.num_rings; i++)amdgpu_ring_fini (&adev->vce.ring[i]);
Signature · 1 line
2.39.5
Quoted 80 lines · Olivier Kaloudoff
Since commit
037b98a2312e("drm/amdgpu: move UVD and VCE sched entity init after sched init"),drm_sched_entity_init()for the VCE and UVD kernel entities runs in the scheduler-init phase, well after the IP-blocksw_initphase has allocated thevcpu_bos.If probe fails between the two phases,
amdgpu_device_fini_sw()still runs the per-IPsw_finicallbacks for blocks that did completesw_init. Bothamdgpu_vce_sw_fini()andamdgpu_uvd_sw_fini()then calldrm_sched_entity_destroy()on an entity that was never initialized:entity->rqis NULL anddrm_sched_entity_flush()dereferences it, oopsing in whatever context drove the failed probe.The hole was latent-but-safe until commit
2df5efb45425("drm/sched:
Remove redundantentity->rqinitialization and checks") removed the if (!entity->rq) early return that commit1decbf6bb0b4("drm/sched:
Fix entities with 0 rqs.") had put indrm_sched_entity_flush(), on the grounds thatentity->rqcan never be NULL. That holds only for entities that completeddrm_sched_entity_init()— not for the never-initialized entity this teardown path reaches.Observed on real hardware: MI50 (Vega20, VCE 4.0 / UVD 7.2) behind a Thunderbolt link — a pciehp presence/link-change event re-probes the device; when the re-probe fails (
-EINVALhere), the cleanup path NULL-derefs insidedrm_sched_entity_flush()in the pciehp IRQ thread and takes the whole machine down (panic_on_oops, EFI pstore capture). Reproduced twice on 7.3-rc5, 2026-10-06 and 2026-10-09, identical signature; the faulting instruction ismov (%rax),%r15on rax =entity->rq== NULL, i.e.sched = entity->rq->sched:BUG: kernel NULL pointer dereference RIP: drm_sched_entity_flush+0x34/0x2d0 [gpu_sched] drm_sched_entity_destroy amdgpu_vce_sw_fini vce_v4_0_sw_fini amdgpu_device_fini_sw ... pciehp_configure_device pciehp_handle_presence_or_link_changeGuard the entity teardown on
entity->rq, which is set only bydrm_sched_entity_init().amdgpu_ring_fini()already self-guards via the rings[] registration, and the vcpu_bo/firmware cleanup still runs as before.v2: retarget Fixes: at commit
2df5efb45425("drm/sched: Remove redundantentity->rqinitialization and checks") — the !entity->rq check from commit1decbf6bb0b4("drm/sched: Fix entities with 0 rqs.") that Alex pointed to was removed by it in the 7.3 window, so this is a regression there, not a pre-existing hole.Fixes 2df5efb45425 ("drm/sched: Remove redundant entity->rq initialization and checks")Cc Tvrtko Ursulin <[email protected]>Cc Philipp Stanner <[email protected]>Cc Alex Deucher <[email protected]>Cc Christian König <[email protected]>Signed-off-by Olivier Kaloudoff <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 3 ++- drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c +2
-1@@ -377,7 +377,8 @@ int amdgpu_uvd_sw_fini(struct amdgpu_device *adev)void *addr =amdgpu_bo_kptr (adev->uvd.ib_bo);int i, j; -drm_sched_entity_destroy (&adev->uvd.entity); +if (adev->uvd.entity.rq) +drm_sched_entity_destroy (&adev->uvd.entity);for (j =0 ; j < adev->uvd.num_uvd_inst; ++j) {if (adev->uvd.harvest_config & (1 << j))drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c +0
-0
drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c int amdgpu_vce_sw_fini(struct amdgpu_device *adev) · line 260
Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c +2
-1@@ -253,7 +253,8 @@ int amdgpu_vce_sw_fini(struct amdgpu_device *adev)if (adev->vce.vcpu_bo ==NULL )return 0 ; -drm_sched_entity_destroy (&adev->vce.entity); +if (adev->vce.entity.rq) +drm_sched_entity_destroy (&adev->vce.entity);for (i =0 ; i < adev->vce.num_rings; i++)amdgpu_ring_fini (&adev->vce.ring[i]);
Dang, it looks like currently the ownership of entity initialization is broken between the IP agnostic phase which does the init, and per-IP phase which tears it down.
The fix will get in the way of me re-trying to embed the run-queue into the scheduler but it does look correct.
I will see if I can re-work the init/cleanup phases so this can be removed, or if not, try to add a proper DRM scheduler API to query the status of an entity.
For now lets merge the fixup.
Regards,
Tvrtko
Quoted 9 lines · Tvrtko Ursulin
Quoted 7 lines · Olivier Kaloudoff
The hole was latent-but-safe until commit
2df5efb45425("drm/sched:
Remove redundantentity->rqinitialization and checks") removed the if (!entity->rq) early return that commit1decbf6bb0b4("drm/sched:
Fix entities with 0 rqs.") had put indrm_sched_entity_flush(), on the grounds thatentity->rqcan never be NULL. That holds only for entities that completeddrm_sched_entity_init()— not for the never-initialized entity this teardown path reaches.
[…]
Quoted 26 lines
Quoted 18 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c +2
-1-drm_sched_entity_destroy (&adev->uvd.entity); +if (adev->uvd.entity.rq) +drm_sched_entity_destroy (&adev->uvd.entity);
for (j = 0; j <adev->uvd.num_uvd_inst; ++j) { if (adev->uvd.harvest_config& (1 << j))drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c +0
-0@@ -253,7 +253,8 @@ int amdgpu_vce_sw_fini(struct amdgpu_device *adev) if (adev->vce.vcpu_bo == NULL) return 0;drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c +2
-1-drm_sched_entity_destroy (&adev->vce.entity); +if (adev->vce.entity.rq) +drm_sched_entity_destroy (&adev->vce.entity);Quoted 3 lines
for (i = 0; i <adev->vce.num_rings; i++)amdgpu_ring_fini(&adev->vce.ring[i]);Dang, it looks like currently the ownership of entity initialization is broken between the IP agnostic phase which does the init, and per-IP phase which tears it down.
Quoted 2 lines
The fix will get in the way of me re-trying to embed the run-queue into the scheduler but it does look correct.
Couldn't the status be tracked through the vce struct?
if (vce.entity_initialized)
Otherwise you rely on API-internals (again) which is what enabled that bug AFAICS. If it's about amdgpu having called foo_init() or not, then the most robust solution is to track within amdgpu "did I call that function already?" Same applies to all constructors and destructors in the kernel AFAIK.
Quoted 6 lines
Reviewed-by Tvrtko Ursulin <[email protected]>I will see if I can re-work the init/cleanup phases so this can be removed, or if not, try to add a proper DRM scheduler API to query the status of an entity.
An API with which you can query whether a data object that you allocated and that you own had the constructor run by yourself? Or am I misunderstanding something?
P.
Quoted 44 lines · Philipp Stanner
Quoted 9 lines · Tvrtko Ursulin
Quoted 7 lines · Olivier Kaloudoff
The hole was latent-but-safe until commit
2df5efb45425("drm/sched:
Remove redundantentity->rqinitialization and checks") removed the if (!entity->rq) early return that commit1decbf6bb0b4("drm/sched:
Fix entities with 0 rqs.") had put indrm_sched_entity_flush(), on the grounds thatentity->rqcan never be NULL. That holds only for entities that completeddrm_sched_entity_init()— not for the never-initialized entity this teardown path reaches.[…]
Quoted 26 lines
Quoted 12 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c +2
-1-drm_sched_entity_destroy (&adev->uvd.entity); +if (adev->uvd.entity.rq) +drm_sched_entity_destroy (&adev->uvd.entity); for (j = 0; j < adev->uvd.num_uvd_inst; ++j) { if (adev->uvd.harvest_config & (1 << j))drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c +0
-0drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c int amdgpu_vce_sw_fini(struct amdgpu_device *adev) · line 260
Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c +2
-1@@ -253,7 +253,8 @@ int amdgpu_vce_sw_fini(struct amdgpu_device *adev) if (adev->vce.vcpu_bo == NULL) return 0; -drm_sched_entity_destroy (&adev->vce.entity); +if (adev->vce.entity.rq) +drm_sched_entity_destroy (&adev->vce.entity); for (i = 0; i < adev->vce.num_rings; i++) amdgpu_ring_fini(&adev->vce.ring[i]);Dang, it looks like currently the ownership of entity initialization is broken between the IP agnostic phase which does the init, and per-IP phase which tears it down.
Quoted 2 lines
The fix will get in the way of me re-trying to embed the run-queue into the scheduler but it does look correct.
Couldn't the status be tracked through the vce struct?
Quoted 7 lines
if (vce.entity_initialized)
Otherwise you rely on API-internals (again) which is what enabled that bug AFAICS. If it's about amdgpu having called
foo_init()or not, then the most robust solution is to track within amdgpu "did I call that function already?" Same applies to all constructors and destructors in the kernel AFAIK.
Yep, it is such a horrible pattern to rely on being able to call destructors on non-initialized objects. I am looking at some flavour of "track in amdgpu" as priority options. Either by re-arranging the probe steps, or by tracking explicitly.
Quoted 10 lines
Quoted 6 lines
Reviewed-by Tvrtko Ursulin <[email protected]>I will see if I can re-work the init/cleanup phases so this can be removed, or if not, try to add a proper DRM scheduler API to query the status of an entity.
An API with which you can query whether a data object that you allocated and that you own had the constructor run by yourself? Or am I misunderstanding something?
Yeah it would be bad. I don't think it will come to it since there is at least one better option.
Regards,
Tvrtko
Christian König
maintainerQuoted 44 lines · Tvrtko Ursulin
Quoted 42 lines · Philipp Stanner
Quoted 9 lines · Tvrtko Ursulin
Quoted 7 lines · Olivier Kaloudoff
The hole was latent-but-safe until commit
2df5efb45425("drm/sched:
Remove redundantentity->rqinitialization and checks") removed the if (!entity->rq) early return that commit1decbf6bb0b4("drm/sched:
Fix entities with 0 rqs.") had put indrm_sched_entity_flush(), on the grounds thatentity->rqcan never be NULL. That holds only for entities that completeddrm_sched_entity_init()— not for the never-initialized entity this teardown path reaches.[…]
Quoted 22 lines
Quoted 10 lines
-
drm_sched_entity_destroy(&adev->uvd.entity); + if (adev->uvd.entity.rq)
+drm_sched_entity_destroy(&adev->uvd.entity); for (j = 0; j <adev->uvd.num_uvd_inst; ++j) { if (adev->uvd.harvest_config& (1 << j))drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c +0
-0drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c int amdgpu_vce_sw_fini(struct amdgpu_device *adev) · line 259
Quoted 7 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c +2
-0@@ -253,7 +253,8 @@ int amdgpu_vce_sw_fini(struct amdgpu_device *adev) if (adev->vce.vcpu_bo == NULL) return 0; - drm_sched_entity_destroy(&adev->vce.entity); + if (adev->vce.entity.rq) + drm_sched_entity_destroy(&adev->vce.entity); for (i = 0; i < adev->vce.num_rings; i++) amdgpu_ring_fini(&adev->vce.ring[i]);Dang, it looks like currently the ownership of entity initialization is broken between the IP agnostic phase which does the init, and per-IP phase which tears it down.
Quoted 2 lines
The fix will get in the way of me re-trying to embed the run-queue into the scheduler but it does look correct.
Couldn't the status be tracked through the vce struct?
if (vce.entity_initialized)
Quoted 7 lines
Quoted 5 lines
Otherwise you rely on API-internals (again) which is what enabled that bug AFAICS. If it's about amdgpu having called
foo_init()or not, then the most robust solution is to track within amdgpu "did I call that function already?" Same applies to all constructors and destructors in the kernel AFAIK.Yep, it is such a horrible pattern to rely on being able to call destructors on non-initialized objects. I am looking at some flavour of "track in amdgpu" as priority options. Either by re-arranging the probe steps, or by tracking explicitly.
Yeah the problem goes deeper than the DRM scheduler here.
Normally the sw_fini callback should only be called when the sw_init callback succeeded. Same for the hw_init/hw_fini.
Somehow amdgpu tries to tear down an IP block which was never full initialized in the first place. The scheduler is just the first component where it becomes obvious that something is going wrong here.
So we need to take a step back and ask why sw_fini is called for something that was never initialized *OR* maybe why the DRM scheduler init is somewhere else than the fini.
Regards,
Christian.
Quoted 18 lines
Quoted 11 lines
Quoted 7 lines
Reviewed-by Tvrtko Ursulin <[email protected]>I will see if I can re-work the init/cleanup phases so this can be removed, or if not, try to add a proper DRM scheduler API to query the status of an entity.
An API with which you can query whether a data object that you allocated and that you own had the constructor run by yourself? Or am I misunderstanding something?
Yeah it would be bad. I don't think it will come to it since there is at least one better option.
Regards,
Tvrtko
Quoted 53 lines · Christian König
Quoted 44 lines · Tvrtko Ursulin
Quoted 42 lines · Philipp Stanner
Quoted 9 lines · Tvrtko Ursulin
Quoted 7 lines · Olivier Kaloudoff
The hole was latent-but-safe until commit
2df5efb45425("drm/sched:
Remove redundantentity->rqinitialization and checks") removed the if (!entity->rq) early return that commit1decbf6bb0b4("drm/sched:
Fix entities with 0 rqs.") had put indrm_sched_entity_flush(), on the grounds thatentity->rqcan never be NULL. That holds only for entities that completeddrm_sched_entity_init()— not for the never-initialized entity this teardown path reaches.[…]
Quoted 22 lines
Quoted 10 lines
-
drm_sched_entity_destroy(&adev->uvd.entity);
+ if (adev->uvd.entity.rq)
+drm_sched_entity_destroy(&adev->uvd.entity);
for (j = 0; j <adev->uvd.num_uvd_inst; ++j) { if (adev->uvd.harvest_config& (1 << j))drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c +0
-0drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c int amdgpu_vce_sw_fini(struct amdgpu_device *adev) · line 259
Quoted 7 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c +2
-0@@ -253,7 +253,8 @@ int amdgpu_vce_sw_fini(struct amdgpu_device *adev) if (adev->vce.vcpu_bo == NULL) return 0; - drm_sched_entity_destroy(&adev->vce.entity); + if (adev->vce.entity.rq) + drm_sched_entity_destroy(&adev->vce.entity); for (i = 0; i < adev->vce.num_rings; i++) amdgpu_ring_fini(&adev->vce.ring[i]);Dang, it looks like currently the ownership of entity initialization is broken between the IP agnostic phase which does the init, and per-IP phase which tears it down.
Quoted 2 lines
The fix will get in the way of me re-trying to embed the run-queue into the scheduler but it does look correct.
Couldn't the status be tracked through the vce struct?
if (vce.entity_initialized)
Quoted 7 lines
Quoted 5 lines
Otherwise you rely on API-internals (again) which is what enabled that bug AFAICS. If it's about amdgpu having called
foo_init()or not, then the most robust solution is to track within amdgpu "did I call that function already?" Same applies to all constructors and destructors in the kernel AFAIK.Yep, it is such a horrible pattern to rely on being able to call destructors on non-initialized objects. I am looking at some flavour of "track in amdgpu" as priority options. Either by re-arranging the probe steps, or by tracking explicitly.
Quoted 7 lines
Yeah the problem goes deeper than the DRM scheduler here.
Normally the
sw_finicallback should only be called when thesw_initcallback succeeded. Same for the hw_init/hw_fini.Somehow amdgpu tries to tear down an IP block which was never full initialized in the first place. The scheduler is just the first component where it becomes obvious that something is going wrong here.
So we need to take a step back and ask why
sw_finiis called for something that was never initialized *OR* maybe why the DRM scheduler init is somewhere else than the fini.
Problem is entity is initialized outside of sw_init (after), while destroy is done on sw_fini.
Flow is roughly like this:
amdgpu_device_ip_init
sw_init
... danger zone ...
amdgpu_device_init_schedulers (this initializes the entity)
So any probe failure inside the danger zone calls (correctly) sw_fini and that calls drm_sched_entity_destroy (incorrectly).
I tried moving entity init into the ip block domain, to fix the confused "ownership", but it is all interleaved and not straightforward to untangle. For now I gave up and have a local patch which adds an explicit flag. I'll send it once this one propagates to some visible branch.
At least I have some new trivial cleanup patches as a bonus result, which I will also send soon.
Regards,
Tvrtko
Quoted 17 lines
Quoted 16 lines
Quoted 9 lines
Quoted 5 lines
Reviewed-by Tvrtko Ursulin <[email protected]>I will see if I can re-work the init/cleanup phases so this can be removed, or if not, try to add a proper DRM scheduler API to query the status of an entity.
An API with which you can query whether a data object that you allocated and that you own had the constructor run by yourself? Or am I misunderstanding something?
Yeah it would be bad. I don't think it will come to it since there is at least one better option.
Regards,
Tvrtko
Alex Deucher
AppliedApplied. Thanks!
Alex
Quoted 92 lines · Olivier Kaloudoff
Since commit
037b98a2312e("drm/amdgpu: move UVD and VCE sched entity init after sched init"),drm_sched_entity_init()for the VCE and UVD kernel entities runs in the scheduler-init phase, well after the IP-blocksw_initphase has allocated thevcpu_bos.If probe fails between the two phases,
amdgpu_device_fini_sw()still runs the per-IPsw_finicallbacks for blocks that did completesw_init. Bothamdgpu_vce_sw_fini()andamdgpu_uvd_sw_fini()then calldrm_sched_entity_destroy()on an entity that was never initialized:entity->rqis NULL anddrm_sched_entity_flush()dereferences it, oopsing in whatever context drove the failed probe.The hole was latent-but-safe until commit
2df5efb45425("drm/sched:
Remove redundantentity->rqinitialization and checks") removed the if (!entity->rq) early return that commit1decbf6bb0b4("drm/sched:
Fix entities with 0 rqs.") had put indrm_sched_entity_flush(), on the grounds thatentity->rqcan never be NULL. That holds only for entities that completeddrm_sched_entity_init()— not for the never-initialized entity this teardown path reaches.Observed on real hardware: MI50 (Vega20, VCE 4.0 / UVD 7.2) behind a Thunderbolt link — a pciehp presence/link-change event re-probes the device; when the re-probe fails (
-EINVALhere), the cleanup path NULL-derefs insidedrm_sched_entity_flush()in the pciehp IRQ thread and takes the whole machine down (panic_on_oops, EFI pstore capture). Reproduced twice on 7.3-rc5, 2026-10-06 and 2026-10-09, identical signature; the faulting instruction ismov (%rax),%r15on rax =entity->rq== NULL, i.e.sched = entity->rq->sched:BUG: kernel NULL pointer dereference RIP: drm_sched_entity_flush+0x34/0x2d0 [gpu_sched] drm_sched_entity_destroy amdgpu_vce_sw_fini vce_v4_0_sw_fini amdgpu_device_fini_sw ... pciehp_configure_device pciehp_handle_presence_or_link_changeGuard the entity teardown on
entity->rq, which is set only bydrm_sched_entity_init().amdgpu_ring_fini()already self-guards via the rings[] registration, and the vcpu_bo/firmware cleanup still runs as before.v2: retarget Fixes: at commit
2df5efb45425("drm/sched: Remove redundantentity->rqinitialization and checks") — the !entity->rq check from commit1decbf6bb0b4("drm/sched: Fix entities with 0 rqs.") that Alex pointed to was removed by it in the 7.3 window, so this is a regression there, not a pre-existing hole.Fixes 2df5efb45425 ("drm/sched: Remove redundant entity->rq initialization and checks")Cc Tvrtko Ursulin <[email protected]>Cc Philipp Stanner <[email protected]>Cc Alex Deucher <[email protected]>Cc Christian König <[email protected]>Signed-off-by Olivier Kaloudoff <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 3 ++- drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c +2
-1@@ -377,7 +377,8 @@ int amdgpu_uvd_sw_fini(struct amdgpu_device *adev)void *addr =amdgpu_bo_kptr (adev->uvd.ib_bo);int i, j; -drm_sched_entity_destroy (&adev->uvd.entity); +if (adev->uvd.entity.rq) +drm_sched_entity_destroy (&adev->uvd.entity);for (j =0 ; j < adev->uvd.num_uvd_inst; ++j) {if (adev->uvd.harvest_config & (1 << j))drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c +2
-2@@ -253,7 +253,8 @@ int amdgpu_vce_sw_fini(struct amdgpu_device *adev)if (adev->vce.vcpu_bo ==NULL )return 0 ; -drm_sched_entity_destroy (&adev->vce.entity); +if (adev->vce.entity.rq) +drm_sched_entity_destroy (&adev->vce.entity);for (i =0 ; i < adev->vce.num_rings; i++)amdgpu_ring_fini (&adev->vce.ring[i]); --2.39.5