Hi all, Today's linux-next merge of the drm tree got a conflict in: drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c between commit: 67cf83ac8316a ("Revert "drm/sched: Embed run queue singleton into the scheduler"") from the drm-misc-fixes tree and commits: 4a33d82e224c8 ("drm/amdgpu: protect XCP scheduler selection") fa1531170d2c9 ("drm/amdgpu: add check for xcp id") 6e8a3c24bd75f ("drm/amdgpu: bounds check xcp_id in release_sched") 7445035dd3f22 ("drm/amdgpu: bounds check xcp ip block index") 62d8b452615fd ("drm/amdgpu: Fix kobject cleanup in xcp sysfs") from the drm tree. I fixed it up (see below) and can carry the fix as necessary. This is now fixed as far as linux-next is concerned, but any non trivial conflicts should be mentioned to your upstream maintainer when your tree is submitted for merging. You may also want to consider cooperating with the maintainer of the conflicting tree to minimise any particularly complex conflicts. diff --cc drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c index 42be8ee155dde,35faea0ff17ff..0000000000000 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c @@@ -466,16 -467,20 +467,21 @@@ int amdgpu_xcp_open_device(struct amdgp void amdgpu_xcp_release_sched(struct amdgpu_device *adev, struct amdgpu_ctx_entity *entity) { - struct drm_gpu_scheduler *sched = - container_of(entity->entity.rq, typeof(*sched), rq); + struct drm_gpu_scheduler *sched; + struct amdgpu_ring *ring; + struct amdgpu_xcp_mgr *xcp_mgr = adev->xcp_mgr; - if (!adev->xcp_mgr) + if (!xcp_mgr) return; + sched = entity->entity.rq->sched; if (drm_sched_wqueue_ready(sched)) { - struct amdgpu_ring *ring = to_amdgpu_ring(sched); + ring = to_amdgpu_ring(entity->entity.rq->sched); - atomic_dec(&adev->xcp_mgr->xcp[ring->xcp_id].ref_cnt); + + mutex_lock(&xcp_mgr->xcp_lock); + if (ring->xcp_id < xcp_mgr->num_xcps && xcp_mgr->xcp[ring->xcp_id].valid) + atomic_dec(&xcp_mgr->xcp[ring->xcp_id].ref_cnt); + mutex_unlock(&xcp_mgr->xcp_lock); } }