Skip to contentSkip to conversation

drivers/gpu/drm/panthor/panthor_sched.c:2024:15-20: ERROR: invalid reference to the index variable of the iterator on line 1997

DISCUSSION kernel test robot 1 participant 1 message Sep 30, 2024

lore
Share & tools
lore

kernel test robot

author build bot
#0 lore raw

BCC: [email protected]
CC: [email protected]
CC: [email protected]
TO: Boris Brezillon <[email protected]>
CC: Steven Price <[email protected]>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   9852d85ec9d492ebef56dc5f229416c925758edc
commit: d72f049087d4f973f6332b599c92177e718107de drm/panthor: Allow driver compilation
date:   7 months ago

:::::: branch date: 18 hours ago
:::::: commit date: 7 months ago
config: sparc-randconfig-r064-20240930 (https://download.01.org/0day-ci/archive/20240930/[email protected]/config)
compiler: sparc64-linux-gcc (GCC) 14.1.0

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags

| Reported-by: kernel test robot <[email protected]>
| Reported-by: Julia Lawall <[email protected]>
| Closes: https://lore.kernel.org/r/[email protected]/

cocci warnings: (new ones prefixed by >>)

>> drivers/gpu/drm/panthor/panthor_sched.c:2024:15-20: ERROR: invalid reference to the index variable of the iterator on line 1997

drivers/gpu/drm/panthor/panthor_sched.c:2024:15-20: ERROR: invalid reference to the index variable of the iterator on line 2027

vim +2024 drivers/gpu/drm/panthor/panthor_sched.c

de85488138247d Boris Brezillon 2024-02-29  1988  
de85488138247d Boris Brezillon 2024-02-29  1989  static void
de85488138247d Boris Brezillon 2024-02-29  1990  tick_ctx_cleanup(struct panthor_scheduler *sched,
de85488138247d Boris Brezillon 2024-02-29  1991  		 struct panthor_sched_tick_ctx *ctx)
de85488138247d Boris Brezillon 2024-02-29  1992  {
de85488138247d Boris Brezillon 2024-02-29  1993  	struct panthor_group *group, *tmp;
de85488138247d Boris Brezillon 2024-02-29  1994  	u32 i;
de85488138247d Boris Brezillon 2024-02-29  1995  
de85488138247d Boris Brezillon 2024-02-29  1996  	for (i = 0; i < ARRAY_SIZE(ctx->old_groups); i++) {
de85488138247d Boris Brezillon 2024-02-29 @1997  		list_for_each_entry_safe(group, tmp, &ctx->old_groups[i], run_node) {
de85488138247d Boris Brezillon 2024-02-29  1998  			/* If everything went fine, we should only have groups
de85488138247d Boris Brezillon 2024-02-29  1999  			 * to be terminated in the old_groups lists.
de85488138247d Boris Brezillon 2024-02-29  2000  			 */
de85488138247d Boris Brezillon 2024-02-29  2001  			drm_WARN_ON(&group->ptdev->base, !ctx->csg_upd_failed_mask &&
de85488138247d Boris Brezillon 2024-02-29  2002  				    group_can_run(group));
de85488138247d Boris Brezillon 2024-02-29  2003  
de85488138247d Boris Brezillon 2024-02-29  2004  			if (!group_can_run(group)) {
de85488138247d Boris Brezillon 2024-02-29  2005  				list_del_init(&group->run_node);
de85488138247d Boris Brezillon 2024-02-29  2006  				list_del_init(&group->wait_node);
de85488138247d Boris Brezillon 2024-02-29  2007  				group_queue_work(group, term);
de85488138247d Boris Brezillon 2024-02-29  2008  			} else if (group->csg_id >= 0) {
de85488138247d Boris Brezillon 2024-02-29  2009  				list_del_init(&group->run_node);
de85488138247d Boris Brezillon 2024-02-29  2010  			} else {
de85488138247d Boris Brezillon 2024-02-29  2011  				list_move(&group->run_node,
de85488138247d Boris Brezillon 2024-02-29  2012  					  group_is_idle(group) ?
de85488138247d Boris Brezillon 2024-02-29  2013  					  &sched->groups.idle[group->priority] :
de85488138247d Boris Brezillon 2024-02-29  2014  					  &sched->groups.runnable[group->priority]);
de85488138247d Boris Brezillon 2024-02-29  2015  			}
de85488138247d Boris Brezillon 2024-02-29  2016  			group_put(group);
de85488138247d Boris Brezillon 2024-02-29  2017  		}
de85488138247d Boris Brezillon 2024-02-29  2018  	}
de85488138247d Boris Brezillon 2024-02-29  2019  
de85488138247d Boris Brezillon 2024-02-29  2020  	for (i = 0; i < ARRAY_SIZE(ctx->groups); i++) {
de85488138247d Boris Brezillon 2024-02-29  2021  		/* If everything went fine, the groups to schedule lists should
de85488138247d Boris Brezillon 2024-02-29  2022  		 * be empty.
de85488138247d Boris Brezillon 2024-02-29  2023  		 */
de85488138247d Boris Brezillon 2024-02-29 @2024  		drm_WARN_ON(&group->ptdev->base,
de85488138247d Boris Brezillon 2024-02-29  2025  			    !ctx->csg_upd_failed_mask && !list_empty(&ctx->groups[i]));
de85488138247d Boris Brezillon 2024-02-29  2026  
de85488138247d Boris Brezillon 2024-02-29  2027  		list_for_each_entry_safe(group, tmp, &ctx->groups[i], run_node) {
de85488138247d Boris Brezillon 2024-02-29  2028  			if (group->csg_id >= 0) {
de85488138247d Boris Brezillon 2024-02-29  2029  				list_del_init(&group->run_node);
de85488138247d Boris Brezillon 2024-02-29  2030  			} else {
de85488138247d Boris Brezillon 2024-02-29  2031  				list_move(&group->run_node,
de85488138247d Boris Brezillon 2024-02-29  2032  					  group_is_idle(group) ?
de85488138247d Boris Brezillon 2024-02-29  2033  					  &sched->groups.idle[group->priority] :
de85488138247d Boris Brezillon 2024-02-29  2034  					  &sched->groups.runnable[group->priority]);
de85488138247d Boris Brezillon 2024-02-29  2035  			}
de85488138247d Boris Brezillon 2024-02-29  2036  			group_put(group);
de85488138247d Boris Brezillon 2024-02-29  2037  		}
de85488138247d Boris Brezillon 2024-02-29  2038  	}
de85488138247d Boris Brezillon 2024-02-29  2039  }
de85488138247d Boris Brezillon 2024-02-29  2040  

:::::: The code at line 2024 was first introduced by commit
:::::: de85488138247d034eb3241840424a54d660926b drm/panthor: Add the scheduler logical block

:::::: TO: Boris Brezillon <[email protected]> :::::: CC: Boris Brezillon <[email protected]>

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki