Re: [PATCH v6 1/5] drm/panthor: introduce job cycle and timestamp accounting

From: kernel test robot
Date: Sun Sep 15 2024 - 11:23:02 EST


Hi Adrián,

kernel test robot noticed the following build errors:

[auto build test ERROR on linus/master]
[also build test ERROR on v6.11-rc7 next-20240913]
[cannot apply to drm-misc/drm-misc-next]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url: https://github.com/intel-lab-lkp/linux/commits/Adri-n-Larumbe/drm-panthor-introduce-job-cycle-and-timestamp-accounting/20240913-205038
base: linus/master
patch link: https://lore.kernel.org/r/20240913124857.389630-2-adrian.larumbe%40collabora.com
patch subject: [PATCH v6 1/5] drm/panthor: introduce job cycle and timestamp accounting
config: i386-buildonly-randconfig-003-20240915 (https://download.01.org/0day-ci/archive/20240915/202409152243.r3t2jdOJ-lkp@xxxxxxxxx/config)
compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240915/202409152243.r3t2jdOJ-lkp@xxxxxxxxx/reproduce)

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 <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202409152243.r3t2jdOJ-lkp@xxxxxxxxx/

All errors (new ones prefixed by >>):

>> drivers/gpu/drm/panthor/panthor_sched.c:2885:12: error: call to '__compiletime_assert_371' declared with 'error' attribute: min(ringbuf_size - start, size) signedness error
2885 | written = min(ringbuf_size - start, size);
| ^
include/linux/minmax.h:129:19: note: expanded from macro 'min'
129 | #define min(x, y) __careful_cmp(min, x, y)
| ^
include/linux/minmax.h:105:2: note: expanded from macro '__careful_cmp'
105 | __careful_cmp_once(op, x, y, __UNIQUE_ID(x_), __UNIQUE_ID(y_))
| ^
include/linux/minmax.h:100:2: note: expanded from macro '__careful_cmp_once'
100 | BUILD_BUG_ON_MSG(!__types_ok(x,y,ux,uy), \
| ^
note: (skipping 2 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler_types.h:498:2: note: expanded from macro '_compiletime_assert'
498 | __compiletime_assert(condition, msg, prefix, suffix)
| ^
include/linux/compiler_types.h:491:4: note: expanded from macro '__compiletime_assert'
491 | prefix ## suffix(); \
| ^
<scratch space>:68:1: note: expanded from here
68 | __compiletime_assert_371
| ^
1 error generated.


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

2862
2863 #define JOB_INSTR(__prof, __instr) \
2864 { \
2865 .profile_mask = __prof, \
2866 .instr = __instr, \
2867 }
2868
2869 static void
2870 copy_instrs_to_ringbuf(struct panthor_queue *queue,
2871 struct panthor_job *job,
2872 struct panthor_job_ringbuf_instrs *instrs)
2873 {
2874 ssize_t ringbuf_size = panthor_kernel_bo_size(queue->ringbuf);
2875 u32 start = job->ringbuf.start & (ringbuf_size - 1);
2876 ssize_t size, written;
2877
2878 /*
2879 * We need to write a whole slot, including any trailing zeroes
2880 * that may come at the end of it. Also, because instrs.buffer has
2881 * been zero-initialised, there's no need to pad it with 0's
2882 */
2883 instrs->count = ALIGN(instrs->count, NUM_INSTRS_PER_CACHE_LINE);
2884 size = instrs->count * sizeof(u64);
> 2885 written = min(ringbuf_size - start, size);
2886
2887 memcpy(queue->ringbuf->kmap + start, instrs->buffer, written);
2888
2889 if (written < size)
2890 memcpy(queue->ringbuf->kmap,
2891 &instrs->buffer[(ringbuf_size - start)/sizeof(u64)],
2892 size - written);
2893 }
2894

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