CC: kbuild-...@lists.01.org BCC: l...@intel.com CC: linux-ker...@vger.kernel.org TO: "Christian König" <christian.koe...@amd.com> CC: Alex Deucher <alexander.deuc...@amd.com> CC: Andrey Grodzovsky <andrey.grodzov...@amd.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: 664a393a2663a0f62fc1b18157ccae33dcdbb8c8 commit: d18b8eadd83e3d8d63a45f9479478640dbcfca02 drm/amdgpu: install ctx entities with cmpxchg date: 3 months ago :::::: branch date: 20 hours ago :::::: commit date: 3 months ago config: arc-randconfig-m031-20220524 (https://download.01.org/0day-ci/archive/20220530/202205300101.gb4h5slq-...@intel.com/config) compiler: arceb-elf-gcc (GCC) 11.3.0 If you fix the issue, kindly add following tag where applicable Reported-by: kernel test robot <l...@intel.com> Reported-by: Dan Carpenter <dan.carpen...@oracle.com> smatch warnings: drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c:210 amdgpu_ctx_init_entity() warn: missing error code 'r' vim +/r +210 drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c 1c6d567bdf73a2 Nirmoy Das 2020-04-01 164 84d588c3de84d0 Nirmoy Das 2021-08-24 165 1c6d567bdf73a2 Nirmoy Das 2020-04-01 166 static int amdgpu_ctx_init_entity(struct amdgpu_ctx *ctx, u32 hw_ip, 1c6d567bdf73a2 Nirmoy Das 2020-04-01 167 const u32 ring) d38ceaf99ed015 Alex Deucher 2015-04-20 168 { 977f7e1068be60 Nirmoy Das 2020-01-21 169 struct amdgpu_device *adev = ctx->adev; 977f7e1068be60 Nirmoy Das 2020-01-21 170 struct amdgpu_ctx_entity *entity; 977f7e1068be60 Nirmoy Das 2020-01-21 171 struct drm_gpu_scheduler **scheds = NULL, *sched = NULL; 977f7e1068be60 Nirmoy Das 2020-01-21 172 unsigned num_scheds = 0; 84d588c3de84d0 Nirmoy Das 2021-08-24 173 int32_t ctx_prio; 1c6d567bdf73a2 Nirmoy Das 2020-04-01 174 unsigned int hw_prio; 84d588c3de84d0 Nirmoy Das 2021-08-24 175 enum drm_sched_priority drm_prio; 47f38501f11fa4 Christian König 2015-08-04 176 int r; d38ceaf99ed015 Alex Deucher 2015-04-20 177 201a4eb9dc960b Gustavo A. R. Silva 2020-10-08 178 entity = kzalloc(struct_size(entity, fences, amdgpu_sched_jobs), 1b1f2fecb699bb Christian König 2018-08-01 179 GFP_KERNEL); 977f7e1068be60 Nirmoy Das 2020-01-21 180 if (!entity) 63e3ab9a8226c0 Nirmoy Das 2020-01-21 181 return -ENOMEM; 63e3ab9a8226c0 Nirmoy Das 2020-01-21 182 84d588c3de84d0 Nirmoy Das 2021-08-24 183 ctx_prio = (ctx->override_priority == AMDGPU_CTX_PRIORITY_UNSET) ? 977f7e1068be60 Nirmoy Das 2020-01-21 184 ctx->init_priority : ctx->override_priority; 84d588c3de84d0 Nirmoy Das 2021-08-24 185 entity->sequence = 1; 84d588c3de84d0 Nirmoy Das 2021-08-24 186 hw_prio = amdgpu_ctx_get_hw_prio(ctx, hw_ip); 84d588c3de84d0 Nirmoy Das 2021-08-24 187 drm_prio = amdgpu_ctx_to_drm_sched_prio(ctx_prio); 1c6d567bdf73a2 Nirmoy Das 2020-04-01 188 1c6d567bdf73a2 Nirmoy Das 2020-04-01 189 hw_ip = array_index_nospec(hw_ip, AMDGPU_HW_IP_NUM); 1c6d567bdf73a2 Nirmoy Das 2020-04-01 190 scheds = adev->gpu_sched[hw_ip][hw_prio].sched; 1c6d567bdf73a2 Nirmoy Das 2020-04-01 191 num_scheds = adev->gpu_sched[hw_ip][hw_prio].num_scheds; 1c6d567bdf73a2 Nirmoy Das 2020-04-01 192 bc21585f3ff050 Nirmoy Das 2020-08-29 193 /* disable load balance if the hw engine retains context among dependent jobs */ bc21585f3ff050 Nirmoy Das 2020-08-29 194 if (hw_ip == AMDGPU_HW_IP_VCN_ENC || bc21585f3ff050 Nirmoy Das 2020-08-29 195 hw_ip == AMDGPU_HW_IP_VCN_DEC || bc21585f3ff050 Nirmoy Das 2020-08-29 196 hw_ip == AMDGPU_HW_IP_UVD_ENC || bc21585f3ff050 Nirmoy Das 2020-08-29 197 hw_ip == AMDGPU_HW_IP_UVD) { 1c6d567bdf73a2 Nirmoy Das 2020-04-01 198 sched = drm_sched_pick_best(scheds, num_scheds); 4ff7d8ba4c80b8 Nirmoy Das 2020-03-13 199 scheds = &sched; 4ff7d8ba4c80b8 Nirmoy Das 2020-03-13 200 num_scheds = 1; 845e6fdf3b52ae Christian König 2018-07-13 201 } 845e6fdf3b52ae Christian König 2018-07-13 202 84d588c3de84d0 Nirmoy Das 2021-08-24 203 r = drm_sched_entity_init(&entity->entity, drm_prio, scheds, num_scheds, 977f7e1068be60 Nirmoy Das 2020-01-21 204 &ctx->guilty); 47f38501f11fa4 Christian König 2015-08-04 205 if (r) 977f7e1068be60 Nirmoy Das 2020-01-21 206 goto error_free_entity; 9cb7e5a91f6cd4 Chunming Zhou 2015-07-21 207 d18b8eadd83e3d Christian König 2022-02-23 208 /* It's not an error if we fail to install the new entity */ d18b8eadd83e3d Christian König 2022-02-23 209 if (cmpxchg(&ctx->entities[hw_ip][ring], NULL, entity)) d18b8eadd83e3d Christian König 2022-02-23 @210 goto cleanup_entity; d18b8eadd83e3d Christian König 2022-02-23 211 8ed8147abc7cf1 Huang Rui 2016-10-26 212 return 0; 8ed8147abc7cf1 Huang Rui 2016-10-26 213 d18b8eadd83e3d Christian König 2022-02-23 214 cleanup_entity: d18b8eadd83e3d Christian König 2022-02-23 215 drm_sched_entity_fini(&entity->entity); d18b8eadd83e3d Christian König 2022-02-23 216 977f7e1068be60 Nirmoy Das 2020-01-21 217 error_free_entity: 977f7e1068be60 Nirmoy Das 2020-01-21 218 kfree(entity); 1b1f2fecb699bb Christian König 2018-08-01 219 977f7e1068be60 Nirmoy Das 2020-01-21 220 return r; 63e3ab9a8226c0 Nirmoy Das 2020-01-21 221 } 63e3ab9a8226c0 Nirmoy Das 2020-01-21 222 -- 0-DAY CI Kernel Test Service https://01.org/lkp _______________________________________________ kbuild mailing list -- kbuild@lists.01.org To unsubscribe send an email to kbuild-le...@lists.01.org