[linux-next:master 2603/3192] drivers/gpu/drm/xe/xe_irq.c:303:22: error: static assertion expression is not an integral constant expression

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   4176cf5c5651c33769de83bb61b0287f4ec7719f
commit: 87ae2755f0b3171fc50a001ebf4ac1b38c7950f4 [2603/3192] build_bug.h: more user friendly error messages in BUILD_BUG_ON_ZERO()
config: arm-randconfig-002-20241214 (https://download.01.org/0day-ci/archive/20241214/202412140429.jB3uBYPX-lkp@xxxxxxxxx/config)
compiler: clang version 15.0.7 (https://github.com/llvm/llvm-project 8dfdcc7b7bf66834a761bd8de445840ef68e4d1a)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241214/202412140429.jB3uBYPX-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/202412140429.jB3uBYPX-lkp@xxxxxxxxx/

All errors (new ones prefixed by >>):

>> drivers/gpu/drm/xe/xe_irq.c:303:22: error: static assertion expression is not an integral constant expression
                   if (!(master_ctl & GT_DW_IRQ(bank)))
                                      ^~~~~~~~~~~~~~~
   drivers/gpu/drm/xe/regs/xe_irq_regs.h:22:27: note: expanded from macro 'GT_DW_IRQ'
   #define   GT_DW_IRQ(x)                          REG_BIT(x)
                                                   ^~~~~~~~~~
   drivers/gpu/drm/xe/compat-i915-headers/../../i915/i915_reg_defs.h:22:9: note: expanded from macro 'REG_BIT'
                  BUILD_BUG_ON_ZERO(__is_constexpr(__n) &&         \
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/build_bug.h:16:35: note: expanded from macro 'BUILD_BUG_ON_ZERO'
   #define BUILD_BUG_ON_ZERO(e, ...) __BUILD_BUG_ON_ZERO(e, ##__VA_ARGS__, #e)
                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/build_bug.h:17:37: note: expanded from macro '__BUILD_BUG_ON_ZERO'
   #define __BUILD_BUG_ON_ZERO(e, msg) __BUILD_BUG_ON_ZERO_MSG(e, msg " is true")
                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler.h:245:77: note: expanded from macro '__BUILD_BUG_ON_ZERO_MSG'
   #define __BUILD_BUG_ON_ZERO_MSG(e, msg) ((int)sizeof(struct {_Static_assert(!(e), msg);}))
                                                                               ^~~~
   drivers/gpu/drm/xe/xe_irq.c:436:26: error: static assertion expression is not an integral constant expression
                   if ((master_tile_ctl & DG1_MSTR_TILE(tile->id)) == 0)
                                          ^~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/xe/regs/xe_irq_regs.h:16:30: note: expanded from macro 'DG1_MSTR_TILE'
   #define   DG1_MSTR_TILE(t)                      REG_BIT(t)
                                                   ^~~~~~~~~~
   drivers/gpu/drm/xe/compat-i915-headers/../../i915/i915_reg_defs.h:22:9: note: expanded from macro 'REG_BIT'
                  BUILD_BUG_ON_ZERO(__is_constexpr(__n) &&         \
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/build_bug.h:16:35: note: expanded from macro 'BUILD_BUG_ON_ZERO'
   #define BUILD_BUG_ON_ZERO(e, ...) __BUILD_BUG_ON_ZERO(e, ##__VA_ARGS__, #e)
                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/build_bug.h:17:37: note: expanded from macro '__BUILD_BUG_ON_ZERO'
   #define __BUILD_BUG_ON_ZERO(e, msg) __BUILD_BUG_ON_ZERO_MSG(e, msg " is true")
                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler.h:245:77: note: expanded from macro '__BUILD_BUG_ON_ZERO_MSG'
   #define __BUILD_BUG_ON_ZERO_MSG(e, msg) ((int)sizeof(struct {_Static_assert(!(e), msg);}))
                                                                               ^~~~
   2 errors generated.
--
>> drivers/gpu/drm/xe/xe_reg_whitelist.c:139:22: error: static assertion expression is not an integral constant expression
           range_start = reg & REG_GENMASK(25, range_bit);
                               ^~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/xe/compat-i915-headers/../../i915/i915_reg_defs.h:49:9: note: expanded from macro 'REG_GENMASK'
                  BUILD_BUG_ON_ZERO(__is_constexpr(__high) &&      \
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/build_bug.h:16:35: note: expanded from macro 'BUILD_BUG_ON_ZERO'
   #define BUILD_BUG_ON_ZERO(e, ...) __BUILD_BUG_ON_ZERO(e, ##__VA_ARGS__, #e)
                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/build_bug.h:17:37: note: expanded from macro '__BUILD_BUG_ON_ZERO'
   #define __BUILD_BUG_ON_ZERO(e, msg) __BUILD_BUG_ON_ZERO_MSG(e, msg " is true")
                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler.h:245:77: note: expanded from macro '__BUILD_BUG_ON_ZERO_MSG'
   #define __BUILD_BUG_ON_ZERO_MSG(e, msg) ((int)sizeof(struct {_Static_assert(!(e), msg);}))
                                                                               ^~~~
   drivers/gpu/drm/xe/xe_reg_whitelist.c:140:28: error: static assertion expression is not an integral constant expression
           range_end = range_start | REG_GENMASK(range_bit, 0);
                                     ^~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/xe/compat-i915-headers/../../i915/i915_reg_defs.h:49:9: note: expanded from macro 'REG_GENMASK'
                  BUILD_BUG_ON_ZERO(__is_constexpr(__high) &&      \
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/build_bug.h:16:35: note: expanded from macro 'BUILD_BUG_ON_ZERO'
   #define BUILD_BUG_ON_ZERO(e, ...) __BUILD_BUG_ON_ZERO(e, ##__VA_ARGS__, #e)
                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/build_bug.h:17:37: note: expanded from macro '__BUILD_BUG_ON_ZERO'
   #define __BUILD_BUG_ON_ZERO(e, msg) __BUILD_BUG_ON_ZERO_MSG(e, msg " is true")
                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler.h:245:77: note: expanded from macro '__BUILD_BUG_ON_ZERO_MSG'
   #define __BUILD_BUG_ON_ZERO_MSG(e, msg) ((int)sizeof(struct {_Static_assert(!(e), msg);}))
                                                                               ^~~~
   2 errors generated.
--
>> drivers/gpu/drm/xe/xe_gt_idle.c:127:33: error: static assertion expression is not an integral constant expression
                           gtidle->powergate_enable |= (VDN_HCP_POWERGATE_ENABLE(j) |
                                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/xe/regs/xe_gt_regs.h:342:40: note: expanded from macro 'VDN_HCP_POWERGATE_ENABLE'
   #define   VDN_HCP_POWERGATE_ENABLE(n)           REG_BIT(3 + 2 * (n))
                                                   ^~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/xe/compat-i915-headers/../../i915/i915_reg_defs.h:22:9: note: expanded from macro 'REG_BIT'
                  BUILD_BUG_ON_ZERO(__is_constexpr(__n) &&         \
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/build_bug.h:16:35: note: expanded from macro 'BUILD_BUG_ON_ZERO'
   #define BUILD_BUG_ON_ZERO(e, ...) __BUILD_BUG_ON_ZERO(e, ##__VA_ARGS__, #e)
                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/build_bug.h:17:37: note: expanded from macro '__BUILD_BUG_ON_ZERO'
   #define __BUILD_BUG_ON_ZERO(e, msg) __BUILD_BUG_ON_ZERO_MSG(e, msg " is true")
                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler.h:245:77: note: expanded from macro '__BUILD_BUG_ON_ZERO_MSG'
   #define __BUILD_BUG_ON_ZERO_MSG(e, msg) ((int)sizeof(struct {_Static_assert(!(e), msg);}))
                                                                               ^~~~
   drivers/gpu/drm/xe/xe_gt_idle.c:128:12: error: static assertion expression is not an integral constant expression
                                                        VDN_MFXVDENC_POWERGATE_ENABLE(j));
                                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/xe/regs/xe_gt_regs.h:343:44: note: expanded from macro 'VDN_MFXVDENC_POWERGATE_ENABLE'
   #define   VDN_MFXVDENC_POWERGATE_ENABLE(n)      REG_BIT(4 + 2 * (n))
                                                   ^~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/xe/compat-i915-headers/../../i915/i915_reg_defs.h:22:9: note: expanded from macro 'REG_BIT'
                  BUILD_BUG_ON_ZERO(__is_constexpr(__n) &&         \
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/build_bug.h:16:35: note: expanded from macro 'BUILD_BUG_ON_ZERO'
   #define BUILD_BUG_ON_ZERO(e, ...) __BUILD_BUG_ON_ZERO(e, ##__VA_ARGS__, #e)
                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/build_bug.h:17:37: note: expanded from macro '__BUILD_BUG_ON_ZERO'
   #define __BUILD_BUG_ON_ZERO(e, msg) __BUILD_BUG_ON_ZERO_MSG(e, msg " is true")
                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler.h:245:77: note: expanded from macro '__BUILD_BUG_ON_ZERO_MSG'
   #define __BUILD_BUG_ON_ZERO_MSG(e, msg) ((int)sizeof(struct {_Static_assert(!(e), msg);}))
                                                                               ^~~~
   2 errors generated.


vim +303 drivers/gpu/drm/xe/xe_irq.c

7e485d9816c134c Matt Roper             2023-06-01  288  
7e485d9816c134c Matt Roper             2023-06-01  289  static void gt_irq_handler(struct xe_tile *tile,
3e8e7ee6a375217 Francois Dugast        2023-07-17  290  			   u32 master_ctl, unsigned long *intr_dw,
dd08ebf6c3525a7 Matthew Brost          2023-03-30  291  			   u32 *identity)
dd08ebf6c3525a7 Matthew Brost          2023-03-30  292  {
7e485d9816c134c Matt Roper             2023-06-01  293  	struct xe_device *xe = tile_to_xe(tile);
a7945ef770dbabe Matt Roper             2024-09-10  294  	struct xe_mmio *mmio = &tile->mmio;
dd08ebf6c3525a7 Matthew Brost          2023-03-30  295  	unsigned int bank, bit;
dd08ebf6c3525a7 Matthew Brost          2023-03-30  296  	u16 instance, intr_vec;
dd08ebf6c3525a7 Matthew Brost          2023-03-30  297  	enum xe_engine_class class;
dd08ebf6c3525a7 Matthew Brost          2023-03-30  298  	struct xe_hw_engine *hwe;
dd08ebf6c3525a7 Matthew Brost          2023-03-30  299  
dd08ebf6c3525a7 Matthew Brost          2023-03-30  300  	spin_lock(&xe->irq.lock);
dd08ebf6c3525a7 Matthew Brost          2023-03-30  301  
dd08ebf6c3525a7 Matthew Brost          2023-03-30  302  	for (bank = 0; bank < 2; bank++) {
6b7ece97dd21d2b Matt Roper             2023-03-31 @303  		if (!(master_ctl & GT_DW_IRQ(bank)))
dd08ebf6c3525a7 Matthew Brost          2023-03-30  304  			continue;
dd08ebf6c3525a7 Matthew Brost          2023-03-30  305  
7e485d9816c134c Matt Roper             2023-06-01  306  		intr_dw[bank] = xe_mmio_read32(mmio, GT_INTR_DW(bank));
dd08ebf6c3525a7 Matthew Brost          2023-03-30  307  		for_each_set_bit(bit, intr_dw + bank, 32)
7e485d9816c134c Matt Roper             2023-06-01  308  			identity[bit] = gt_engine_identity(xe, mmio, bank, bit);
7e485d9816c134c Matt Roper             2023-06-01  309  		xe_mmio_write32(mmio, GT_INTR_DW(bank), intr_dw[bank]);
dd08ebf6c3525a7 Matthew Brost          2023-03-30  310  
dd08ebf6c3525a7 Matthew Brost          2023-03-30  311  		for_each_set_bit(bit, intr_dw + bank, 32) {
7e485d9816c134c Matt Roper             2023-06-01  312  			struct xe_gt *engine_gt;
7e485d9816c134c Matt Roper             2023-06-01  313  
6b7ece97dd21d2b Matt Roper             2023-03-31  314  			class = INTR_ENGINE_CLASS(identity[bit]);
6b7ece97dd21d2b Matt Roper             2023-03-31  315  			instance = INTR_ENGINE_INSTANCE(identity[bit]);
6b7ece97dd21d2b Matt Roper             2023-03-31  316  			intr_vec = INTR_ENGINE_INTR(identity[bit]);
dd08ebf6c3525a7 Matthew Brost          2023-03-30  317  
7e485d9816c134c Matt Roper             2023-06-01  318  			engine_gt = pick_engine_gt(tile, class, instance);
7e485d9816c134c Matt Roper             2023-06-01  319  
3d2b5d4e28d9c58 Daniele Ceraolo Spurio 2023-08-17  320  			hwe = xe_gt_hw_engine(engine_gt, class, instance, false);
3d2b5d4e28d9c58 Daniele Ceraolo Spurio 2023-08-17  321  			if (hwe) {
3d2b5d4e28d9c58 Daniele Ceraolo Spurio 2023-08-17  322  				xe_hw_engine_handle_irq(hwe, intr_vec);
dd08ebf6c3525a7 Matthew Brost          2023-03-30  323  				continue;
dd08ebf6c3525a7 Matthew Brost          2023-03-30  324  			}
dd08ebf6c3525a7 Matthew Brost          2023-03-30  325  
3d2b5d4e28d9c58 Daniele Ceraolo Spurio 2023-08-17  326  			if (class == XE_ENGINE_CLASS_OTHER) {
87a4c85d3a3ed57 Vitaly Lubart          2023-08-28  327  				/* HECI GSCFI interrupts come from outside of GT */
87a4c85d3a3ed57 Vitaly Lubart          2023-08-28  328  				if (HAS_HECI_GSCFI(xe) && instance == OTHER_GSC_INSTANCE)
87a4c85d3a3ed57 Vitaly Lubart          2023-08-28  329  					xe_heci_gsc_irq_handler(xe, intr_vec);
87a4c85d3a3ed57 Vitaly Lubart          2023-08-28  330  				else
3d2b5d4e28d9c58 Daniele Ceraolo Spurio 2023-08-17  331  					gt_other_irq_handler(engine_gt, instance, intr_vec);
3d2b5d4e28d9c58 Daniele Ceraolo Spurio 2023-08-17  332  			}
dd08ebf6c3525a7 Matthew Brost          2023-03-30  333  		}
dd08ebf6c3525a7 Matthew Brost          2023-03-30  334  	}
dd08ebf6c3525a7 Matthew Brost          2023-03-30  335  
dd08ebf6c3525a7 Matthew Brost          2023-03-30  336  	spin_unlock(&xe->irq.lock);
dd08ebf6c3525a7 Matthew Brost          2023-03-30  337  }
dd08ebf6c3525a7 Matthew Brost          2023-03-30  338  

:::::: The code at line 303 was first introduced by commit
:::::: 6b7ece97dd21d2b80a41f6192f89f8848c3b1d76 drm/xe/irq: Drop unnecessary GEN11_ and GEN12_ register prefixes

:::::: TO: Matt Roper <matthew.d.roper@xxxxxxxxx>
:::::: CC: Rodrigo Vivi <rodrigo.vivi@xxxxxxxxx>

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




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux