Hi Arunpravin,

kernel test robot noticed the following build errors:

[auto build test ERROR on 9d757669b2b22cd224c334924f798393ffca537c]

url:    
https://github.com/intel-lab-lkp/linux/commits/Arunpravin-Paneer-Selvam/drm-buddy-Add-KUnit-test-for-offset-aligned-allocations/20260209-163512
base:   9d757669b2b22cd224c334924f798393ffca537c
patch link:    
https://lore.kernel.org/r/20260209083051.13376-2-Arunpravin.PaneerSelvam%40amd.com
patch subject: [PATCH v3 2/2] drm/buddy: Add KUnit test for offset-aligned 
allocations
config: m68k-allmodconfig 
(https://download.01.org/0day-ci/archive/20260210/[email protected]/config)
compiler: m68k-linux-gcc (GCC) 15.2.0
reproduce (this is a W=1 build): 
(https://download.01.org/0day-ci/archive/20260210/[email protected]/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 <[email protected]>
| Closes: 
https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

   drivers/gpu/tests/gpu_buddy_test.c: In function 
'gpu_test_buddy_subtree_offset_alignment_stress':
>> drivers/gpu/tests/gpu_buddy_test.c:46:49: error: macro 'KUNIT_ASSERT_FALSE' 
>> passed 3 arguments, but takes just 2
      46 |                            "buddy_init failed\n");
         |                                                 ^
   In file included from drivers/gpu/tests/gpu_buddy_test.c:7:
   include/kunit/test.h:1390:9: note: macro 'KUNIT_ASSERT_FALSE' defined here
    1390 | #define KUNIT_ASSERT_FALSE(test, condition) \
         |         ^~~~~~~~~~~~~~~~~~
>> drivers/gpu/tests/gpu_buddy_test.c:45:9: error: 'KUNIT_ASSERT_FALSE' 
>> undeclared (first use in this function); did you mean 'KUNIT_ASSERTION'?
      45 |         KUNIT_ASSERT_FALSE(test, gpu_buddy_init(&mm, mm_size, SZ_4K),
         |         ^~~~~~~~~~~~~~~~~~
         |         KUNIT_ASSERTION
   drivers/gpu/tests/gpu_buddy_test.c:45:9: note: each undeclared identifier is 
reported only once for each function it appears in


vim +/KUNIT_ASSERT_FALSE +46 drivers/gpu/tests/gpu_buddy_test.c

    23  
    24  static void gpu_test_buddy_subtree_offset_alignment_stress(struct kunit 
*test)
    25  {
    26          struct gpu_buddy_block *block;
    27          struct rb_node *node = NULL;
    28          const u64 mm_size = SZ_2M;
    29          const u64 alignments[] = {
    30                  SZ_1M,
    31                  SZ_512K,
    32                  SZ_256K,
    33                  SZ_128K,
    34                  SZ_64K,
    35                  SZ_32K,
    36                  SZ_16K,
    37                  SZ_8K,
    38          };
    39  
    40          struct list_head allocated[ARRAY_SIZE(alignments)];
    41          unsigned int i, order, max_subtree_align = 0;
    42          struct gpu_buddy mm;
    43          int ret, tree;
    44  
  > 45          KUNIT_ASSERT_FALSE(test, gpu_buddy_init(&mm, mm_size, SZ_4K),
  > 46                             "buddy_init failed\n");
    47  
    48          for (i = 0; i < ARRAY_SIZE(allocated); i++)
    49                  INIT_LIST_HEAD(&allocated[i]);
    50  
    51          /*
    52           * Exercise subtree_max_alignment tracking by allocating blocks 
with descending
    53           * alignment constraints and freeing them in reverse order. 
This verifies that
    54           * free-tree augmentation correctly propagates the maximum 
offset alignment
    55           * present in each subtree at every stage.
    56           */
    57  
    58          for (i = 0; i < ARRAY_SIZE(alignments); i++) {
    59                  struct gpu_buddy_block *root = NULL;
    60                  unsigned int expected;
    61                  u64 align;
    62  
    63                  align = alignments[i];
    64                  expected = ilog2(align) - 1;
    65  
    66                  for (;;) {
    67                          ret = gpu_buddy_alloc_blocks(&mm,
    68                                                       0, mm_size,
    69                                                       SZ_4K, align,
    70                                                       &allocated[i],
    71                                                       0);
    72                          if (ret)
    73                                  break;
    74  
    75                          block = list_last_entry(&allocated[i],
    76                                                  struct gpu_buddy_block,
    77                                                  link);
    78                          KUNIT_EXPECT_EQ(test, 
gpu_buddy_block_offset(block) & (align - 1), 0ULL);
    79                  }
    80  
    81                  for (order = mm.max_order + 1; order-- > 0 && !root; ) {
    82                          for (tree = 0; tree < 2; tree++) {
    83                                  node = 
mm.free_trees[tree][order].rb_node;
    84                                  if (node) {
    85                                          root = container_of(node,
    86                                                              struct 
gpu_buddy_block,
    87                                                              rb);
    88                                          break;
    89                                  }
    90                          }
    91                  }
    92  
    93                  KUNIT_ASSERT_NOT_NULL(test, root);
    94                  KUNIT_EXPECT_EQ(test, root->subtree_max_alignment, 
expected);
    95          }
    96  
    97          for (i = ARRAY_SIZE(alignments); i-- > 0; ) {
    98                  gpu_buddy_free_list(&mm, &allocated[i], 0);
    99  
   100                  for (order = 0; order <= mm.max_order; order++) {
   101                          for (tree = 0; tree < 2; tree++) {
   102                                  node = 
mm.free_trees[tree][order].rb_node;
   103                                  if (!node)
   104                                          continue;
   105  
   106                                  block = container_of(node, struct 
gpu_buddy_block, rb);
   107                                  max_subtree_align = 
max(max_subtree_align, block->subtree_max_alignment);
   108                          }
   109                  }
   110  
   111                  KUNIT_EXPECT_GE(test, max_subtree_align, 
ilog2(alignments[i]));
   112          }
   113  
   114          gpu_buddy_fini(&mm);
   115  }
   116  

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

Reply via email to