tree:
https://github.com/avpatel/linux.git riscv_sbi_hsm_suspend_v4
head: 918900c33e104747fc2e9249207eabc8154391db
commit: 8a283d8787dc0258a59acdf51f40f44d381de2ce [8/10] cpuidle: Add RISC-V SBI CPU idle
driver
config: riscv-randconfig-r004-20210523 (attached as .config)
compiler: clang version 13.0.0 (
https://github.com/llvm/llvm-project
e84a9b9bb3051c35dea993cdad7b3d2575638f85)
reproduce (this is a W=1 build):
wget
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O
~/bin/make.cross
chmod +x ~/bin/make.cross
# install riscv cross compiling tool for clang build
# apt-get install binutils-riscv64-linux-gnu
#
https://github.com/avpatel/linux/commit/8a283d8787dc0258a59acdf51f40f44d3...
git remote add avpatel
https://github.com/avpatel/linux.git
git fetch --no-tags avpatel riscv_sbi_hsm_suspend_v4
git checkout 8a283d8787dc0258a59acdf51f40f44d381de2ce
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=riscv
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
In file included from drivers/cpuidle/cpuidle-sbi.c:27:
drivers/cpuidle/dt_idle_genpd.h:29:1: error: expected identifier or '('
{
^
drivers/cpuidle/cpuidle-sbi.c:348:5: error: implicit declaration of function
'cpuid_to_hartid_map' [-Werror,-Wimplicit-function-declaration]
cpuid_to_hartid_map(cpu));
^
> drivers/cpuidle/cpuidle-sbi.c:348:5: warning: format specifies
type 'long' but the argument has type 'int' [-Wformat]
cpuid_to_hartid_map(cpu));
^~~~~~~~~~~~~~~~~~~~~~~~
include/linux/printk.h:430:38: note: expanded from macro 'pr_debug'
no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
~~~ ^~~~~~~~~~~
include/linux/printk.h:140:17: note: expanded from macro 'no_printk'
printk(fmt, ##__VA_ARGS__); \
~~~ ^~~~~~~~~~~
drivers/cpuidle/cpuidle-sbi.c:357:10: error: implicit declaration of function
'cpuid_to_hartid_map' [-Werror,-Wimplicit-function-declaration]
cpuid_to_hartid_map(cpu));
^
drivers/cpuidle/cpuidle-sbi.c:357:10: warning: format specifies type 'long' but
the argument has type 'int' [-Wformat]
cpuid_to_hartid_map(cpu));
^~~~~~~~~~~~~~~~~~~~~~~~
include/linux/printk.h:343:33: note: expanded from macro 'pr_err'
printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
~~~ ^~~~~~~~~~~
drivers/cpuidle/cpuidle-sbi.c:565:6: error: implicit declaration of function
'cpuid_to_hartid_map' [-Werror,-Wimplicit-function-declaration]
cpuid_to_hartid_map(cpu));
^
drivers/cpuidle/cpuidle-sbi.c:565:6: warning: format specifies type 'long' but
the argument has type 'int' [-Wformat]
cpuid_to_hartid_map(cpu));
^~~~~~~~~~~~~~~~~~~~~~~~
include/linux/printk.h:430:38: note: expanded from macro 'pr_debug'
no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
~~~ ^~~~~~~~~~~
include/linux/printk.h:140:17: note: expanded from macro 'no_printk'
printk(fmt, ##__VA_ARGS__); \
~~~ ^~~~~~~~~~~
3 warnings and 4 errors generated.
vim +348 drivers/cpuidle/cpuidle-sbi.c
315
316 static int sbi_cpuidle_init_cpu(struct device *dev, int cpu)
317 {
318 struct cpuidle_driver *drv;
319 unsigned int state_count = 0;
320 int ret = 0;
321
322 drv = devm_kzalloc(dev, sizeof(*drv), GFP_KERNEL);
323 if (!drv)
324 return -ENOMEM;
325
326 drv->name = "sbi_cpuidle";
327 drv->owner = THIS_MODULE;
328 drv->cpumask = (struct cpumask *)cpumask_of(cpu);
329
330 /* RISC-V architectural WFI to be represented as state index 0. */
331 drv->states[0].enter = sbi_cpuidle_enter_state;
332 drv->states[0].exit_latency = 1;
333 drv->states[0].target_residency = 1;
334 drv->states[0].power_usage = UINT_MAX;
335 strcpy(drv->states[0].name, "WFI");
336 strcpy(drv->states[0].desc, "RISC-V WFI");
337
338 /*
339 * If no DT idle states are detected (ret == 0) let the driver
340 * initialization fail accordingly since there is no reason to
341 * initialize the idle driver if only wfi is supported, the
342 * default archictectural back-end already executes wfi
343 * on idle entry.
344 */
345 ret = dt_init_idle_driver(drv, sbi_cpuidle_state_match, 1);
346 if (ret <= 0) {
347 pr_debug("HART%ld: failed to parse DT idle states\n",
348 cpuid_to_hartid_map(cpu));
349 return ret ? :
-ENODEV;
350 }
351 state_count = ret + 1; /* Include WFI state as well */
352
353 /* Initialize idle states from DT. */
354 ret = sbi_cpuidle_dt_init_states(dev, drv, cpu, state_count);
355 if (ret) {
356 pr_err("HART%ld: failed to init idle states\n",
357 cpuid_to_hartid_map(cpu));
358 return ret;
359 }
360
361 ret = cpuidle_register(drv, NULL);
362 if (ret)
363 goto deinit;
364
365 cpuidle_cooling_register(drv);
366
367 return 0;
368 deinit:
369 sbi_cpuidle_deinit_cpu(cpu);
370 return ret;
371 }
372
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org