intel-xe.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [drm-xe:drm-xe-next 12/13] drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c:321:15: warning: variable 'end' is uninitialized when used here
@ 2024-04-27  7:43 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2024-04-27  7:43 UTC (permalink / raw)
  To: Matthew Brost; +Cc: llvm, oe-kbuild-all, intel-xe, Oak Zeng

tree:   https://gitlab.freedesktop.org/drm/xe/kernel.git drm-xe-next
head:   98ad158e543426561fa5df5c4387d4368601866f
commit: c4f18703629dd0112641d6974eb295a53c4a4615 [12/13] drm/xe: Add xe_gt_tlb_invalidation_range and convert PT layer to use this
config: powerpc-randconfig-002-20240427 (https://download.01.org/0day-ci/archive/20240427/202404271550.YdQqXkUF-lkp@intel.com/config)
compiler: clang version 19.0.0git (https://github.com/llvm/llvm-project 5ef5eb66fb428aaf61fb51b709f065c069c11242)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240427/202404271550.YdQqXkUF-lkp@intel.com/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@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202404271550.YdQqXkUF-lkp@intel.com/

All warnings (new ones prefixed by >>):

   In file included from drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c:9:
   In file included from drivers/gpu/drm/xe/xe_device.h:12:
   In file included from include/drm/drm_util.h:35:
   In file included from include/linux/interrupt.h:11:
   In file included from include/linux/hardirq.h:11:
   In file included from arch/powerpc/include/asm/hardirq.h:6:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:13:
   In file included from arch/powerpc/include/asm/io.h:24:
   In file included from include/linux/mm.h:2208:
   include/linux/vmstat.h:522:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
     522 |         return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
         |                               ~~~~~~~~~~~ ^ ~~~
>> drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c:321:15: warning: variable 'end' is uninitialized when used here [-Wuninitialized]
     321 |                 end = ALIGN(end, align);
         |                             ^~~
   include/linux/align.h:8:38: note: expanded from macro 'ALIGN'
       8 | #define ALIGN(x, a)             __ALIGN_KERNEL((x), (a))
         |                                                 ^
   include/uapi/linux/const.h:31:51: note: expanded from macro '__ALIGN_KERNEL'
      31 | #define __ALIGN_KERNEL(x, a)            __ALIGN_KERNEL_MASK(x, (__typeof__(x))(a) - 1)
         |                                                             ^
   include/uapi/linux/const.h:32:41: note: expanded from macro '__ALIGN_KERNEL_MASK'
      32 | #define __ALIGN_KERNEL_MASK(x, mask)    (((x) + (mask)) & ~(mask))
         |                                            ^
   drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c:308:17: note: initialize the variable 'end' to silence this warning
     308 |                 u64 align, end;
         |                               ^
         |                                = 0
   2 warnings generated.

Kconfig warnings: (for reference only)
   WARNING: unmet direct dependencies detected for HOTPLUG_CPU
   Depends on [n]: SMP [=y] && (PPC_PSERIES [=n] || PPC_PMAC [=n] || PPC_POWERNV [=n] || FSL_SOC_BOOKE [=n])
   Selected by [y]:
   - PM_SLEEP_SMP [=y] && SMP [=y] && (ARCH_SUSPEND_POSSIBLE [=y] || ARCH_HIBERNATION_POSSIBLE [=y]) && PM_SLEEP [=y]


vim +/end +321 drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c

   264	
   265	/**
   266	 * xe_gt_tlb_invalidation_range - Issue a TLB invalidation on this GT for an
   267	 * address range
   268	 *
   269	 * @gt: graphics tile
   270	 * @fence: invalidation fence which will be signal on TLB invalidation
   271	 * completion, can be NULL
   272	 * @start: start address
   273	 * @end: end address
   274	 * @asid: address space id
   275	 *
   276	 * Issue a range based TLB invalidation if supported, if not fallback to a full
   277	 * TLB invalidation. Completion of TLB is asynchronous and caller can either use
   278	 * the invalidation fence or seqno + xe_gt_tlb_invalidation_wait to wait for
   279	 * completion.
   280	 *
   281	 * Return: Seqno which can be passed to xe_gt_tlb_invalidation_wait on success,
   282	 * negative error code on error.
   283	 */
   284	int xe_gt_tlb_invalidation_range(struct xe_gt *gt,
   285					 struct xe_gt_tlb_invalidation_fence *fence,
   286					 u64 start, u64 end, u32 asid)
   287	{
   288		struct xe_device *xe = gt_to_xe(gt);
   289	#define MAX_TLB_INVALIDATION_LEN	7
   290		u32 action[MAX_TLB_INVALIDATION_LEN];
   291		int len = 0;
   292	
   293		/* Execlists not supported */
   294		if (gt_to_xe(gt)->info.force_execlist) {
   295			if (fence)
   296				__invalidation_fence_signal(fence);
   297	
   298			return 0;
   299		}
   300	
   301		action[len++] = XE_GUC_ACTION_TLB_INVALIDATION;
   302		action[len++] = 0; /* seqno, replaced in send_tlb_invalidation */
   303		if (!xe->info.has_range_tlb_invalidation) {
   304			action[len++] = MAKE_INVAL_OP(XE_GUC_TLB_INVAL_FULL);
   305		} else {
   306			u64 orig_start = start;
   307			u64 length = end - start;
   308			u64 align, end;
   309	
   310			if (length < SZ_4K)
   311				length = SZ_4K;
   312	
   313			/*
   314			 * We need to invalidate a higher granularity if start address
   315			 * is not aligned to length. When start is not aligned with
   316			 * length we need to find the length large enough to create an
   317			 * address mask covering the required range.
   318			 */
   319			align = roundup_pow_of_two(length);
   320			start = ALIGN_DOWN(start, align);
 > 321			end = ALIGN(end, align);
   322			length = align;
   323			while (start + length < end) {
   324				length <<= 1;
   325				start = ALIGN_DOWN(orig_start, length);
   326			}
   327	
   328			/*
   329			 * Minimum invalidation size for a 2MB page that the hardware
   330			 * expects is 16MB
   331			 */
   332			if (length >= SZ_2M) {
   333				length = max_t(u64, SZ_16M, length);
   334				start = ALIGN_DOWN(orig_start, length);
   335			}
   336	
   337			xe_gt_assert(gt, length >= SZ_4K);
   338			xe_gt_assert(gt, is_power_of_2(length));
   339			xe_gt_assert(gt, !(length & GENMASK(ilog2(SZ_16M) - 1,
   340							    ilog2(SZ_2M) + 1)));
   341			xe_gt_assert(gt, IS_ALIGNED(start, length));
   342	
   343			action[len++] = MAKE_INVAL_OP(XE_GUC_TLB_INVAL_PAGE_SELECTIVE);
   344			action[len++] = asid;
   345			action[len++] = lower_32_bits(start);
   346			action[len++] = upper_32_bits(start);
   347			action[len++] = ilog2(length) - ilog2(SZ_4K);
   348		}
   349	
   350		xe_gt_assert(gt, len <= MAX_TLB_INVALIDATION_LEN);
   351	
   352		return send_tlb_invalidation(&gt->uc.guc, fence, action, len);
   353	}
   354	

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-04-27  7:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-27  7:43 [drm-xe:drm-xe-next 12/13] drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c:321:15: warning: variable 'end' is uninitialized when used here kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).