tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master head: ab0b3e6ef50d305278b1971891cf1d82ab050b35 commit: 7984d22f1315bf30433e11e5010e4ce09ca22037 [10859/12059] cxl/region: Add dev_dbg() detail on failure to allocate HPA space config: riscv-randconfig-r022-20221204 (https://download.01.org/0day-ci/archive/20240102/202401022246.En9oIBzU-lkp@xxxxxxxxx/config) compiler: riscv32-linux-gcc (GCC) 13.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240102/202401022246.En9oIBzU-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/202401022246.En9oIBzU-lkp@xxxxxxxxx/ All warnings (new ones prefixed by >>): In file included from include/linux/printk.h:564, from include/asm-generic/bug.h:22, from arch/riscv/include/asm/bug.h:83, from include/linux/bug.h:5, from include/linux/memregion.h:7, from drivers/cxl/core/region.c:3: drivers/cxl/core/region.c: In function 'alloc_hpa': >> drivers/cxl/core/region.c:556:25: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 5 has type 'resource_size_t' {aka 'unsigned int'} [-Wformat=] 556 | "HPA allocation error (%ld) for size:%#llx in %s %pr\n", | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/dynamic_debug.h:224:29: note: in definition of macro '__dynamic_func_call_cls' 224 | func(&id, ##__VA_ARGS__); \ | ^~~~~~~~~~~ include/linux/dynamic_debug.h:250:9: note: in expansion of macro '_dynamic_func_call_cls' 250 | _dynamic_func_call_cls(_DPRINTK_CLASS_DFLT, fmt, func, ##__VA_ARGS__) | ^~~~~~~~~~~~~~~~~~~~~~ include/linux/dynamic_debug.h:273:9: note: in expansion of macro '_dynamic_func_call' 273 | _dynamic_func_call(fmt, __dynamic_dev_dbg, \ | ^~~~~~~~~~~~~~~~~~ include/linux/dev_printk.h:155:9: note: in expansion of macro 'dynamic_dev_dbg' 155 | dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__) | ^~~~~~~~~~~~~~~ include/linux/dev_printk.h:155:30: note: in expansion of macro 'dev_fmt' 155 | dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__) | ^~~~~~~ drivers/cxl/core/region.c:555:17: note: in expansion of macro 'dev_dbg' 555 | dev_dbg(&cxlr->dev, | ^~~~~~~ drivers/cxl/core/region.c:556:66: note: format string is defined here 556 | "HPA allocation error (%ld) for size:%#llx in %s %pr\n", | ~~~~^ | | | long long unsigned int | %#x vim +556 drivers/cxl/core/region.c 522 523 static int alloc_hpa(struct cxl_region *cxlr, resource_size_t size) 524 { 525 struct cxl_root_decoder *cxlrd = to_cxl_root_decoder(cxlr->dev.parent); 526 struct cxl_region_params *p = &cxlr->params; 527 struct resource *res; 528 u32 remainder = 0; 529 530 lockdep_assert_held_write(&cxl_region_rwsem); 531 532 /* Nothing to do... */ 533 if (p->res && resource_size(p->res) == size) 534 return 0; 535 536 /* To change size the old size must be freed first */ 537 if (p->res) 538 return -EBUSY; 539 540 if (p->state >= CXL_CONFIG_INTERLEAVE_ACTIVE) 541 return -EBUSY; 542 543 /* ways, granularity and uuid (if PMEM) need to be set before HPA */ 544 if (!p->interleave_ways || !p->interleave_granularity || 545 (cxlr->mode == CXL_DECODER_PMEM && uuid_is_null(&p->uuid))) 546 return -ENXIO; 547 548 div_u64_rem(size, SZ_256M * p->interleave_ways, &remainder); 549 if (remainder) 550 return -EINVAL; 551 552 res = alloc_free_mem_region(cxlrd->res, size, SZ_256M, 553 dev_name(&cxlr->dev)); 554 if (IS_ERR(res)) { 555 dev_dbg(&cxlr->dev, > 556 "HPA allocation error (%ld) for size:%#llx in %s %pr\n", 557 PTR_ERR(res), size, cxlrd->res->name, cxlrd->res); 558 return PTR_ERR(res); 559 } 560 561 p->res = res; 562 p->state = CXL_CONFIG_INTERLEAVE_ACTIVE; 563 564 return 0; 565 } 566 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki