All of lore.kernel.org
 help / color / mirror / Atom feed
* [linux-next:master 10029/11953] drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c:210 amdgpu_ctx_init_entity() warn: missing error code 'r'
@ 2022-03-10 20:39 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2022-03-10 20:39 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 5921 bytes --]

CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: Linux Memory Management List <linux-mm@kvack.org>
TO: "Christian König" <christian.koenig@amd.com>
CC: Alex Deucher <alexander.deucher@amd.com>
CC: Andrey Grodzovsky <andrey.grodzovsky@amd.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   71941773e143369a73c9c4a3b62fbb60736a1182
commit: d18b8eadd83e3d8d63a45f9479478640dbcfca02 [10029/11953] drm/amdgpu: install ctx entities with cmpxchg
:::::: branch date: 12 hours ago
:::::: commit date: 6 days ago
config: parisc-randconfig-m031-20220310 (https://download.01.org/0day-ci/archive/20220311/202203110409.M2aj0Klv-lkp(a)intel.com/config)
compiler: hppa-linux-gcc (GCC) 11.2.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@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, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [linux-next:master 10029/11953] drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c:210 amdgpu_ctx_init_entity() warn: missing error code 'r'
@ 2022-03-11  5:49 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2022-03-11  5:49 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 5902 bytes --]

CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: Linux Memory Management List <linux-mm@kvack.org>
TO: "Christian König" <christian.koenig@amd.com>
CC: Alex Deucher <alexander.deucher@amd.com>
CC: Andrey Grodzovsky <andrey.grodzovsky@amd.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   71941773e143369a73c9c4a3b62fbb60736a1182
commit: d18b8eadd83e3d8d63a45f9479478640dbcfca02 [10029/11953] drm/amdgpu: install ctx entities with cmpxchg
:::::: branch date: 21 hours ago
:::::: commit date: 7 days ago
config: parisc-randconfig-m031-20220310 (https://download.01.org/0day-ci/archive/20220311/202203111333.Mnna3DNH-lkp(a)intel.com/config)
compiler: hppa-linux-gcc (GCC) 11.2.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@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://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-03-11  5:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-10 20:39 [linux-next:master 10029/11953] drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c:210 amdgpu_ctx_init_entity() warn: missing error code 'r' kernel test robot
2022-03-11  5:49 kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.