[PATCH v3 4/4] RISC-V: Add arch functions to support hibernation/suspend-to-disk

kernel test robot lkp at intel.com
Sat Feb 4 12:42:58 PST 2023


Hi Sia,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on 7c46948a6e9cf47ed03b0d489fde894ad46f1437]

url:    https://github.com/intel-lab-lkp/linux/commits/Sia-Jee-Heng/RISC-V-Change-suspend_save_csrs-and-suspend_restore_csrs-to-public-function/20230128-114249
base:   7c46948a6e9cf47ed03b0d489fde894ad46f1437
patch link:    https://lore.kernel.org/r/20230127091051.1465278-5-jeeheng.sia%40starfivetech.com
patch subject: [PATCH v3 4/4] RISC-V: Add arch functions to support hibernation/suspend-to-disk
config: riscv-randconfig-r001-20230205 (https://download.01.org/0day-ci/archive/20230205/202302050450.VM99IQpW-lkp@intel.com/config)
compiler: riscv64-linux-gcc (GCC) 12.1.0
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
        # https://github.com/intel-lab-lkp/linux/commit/642c1b119b3d33fe0ee22ff6823085cb847cfe79
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Sia-Jee-Heng/RISC-V-Change-suspend_save_csrs-and-suspend_restore_csrs-to-public-function/20230128-114249
        git checkout 642c1b119b3d33fe0ee22ff6823085cb847cfe79
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=riscv olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=riscv SHELL=/bin/bash

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp at intel.com>

All errors (new ones prefixed by >>):

   riscv64-linux-ld: arch/riscv/kernel/hibernate.o: in function `arch_hibernation_header_restore':
>> arch/riscv/kernel/hibernate.c:133: undefined reference to `__cpu_suspend_enter'
>> riscv64-linux-ld: arch/riscv/kernel/hibernate.c:137: undefined reference to `suspend_save_csrs'
>> riscv64-linux-ld: arch/riscv/kernel/hibernate.c:137: undefined reference to `suspend_restore_csrs'
   pahole: .tmp_vmlinux.btf: No such file or directory
   .btf.vmlinux.bin.o: file not recognized: file format not recognized


vim +133 arch/riscv/kernel/hibernate.c

   106	
   107	/*
   108	 * Retrieve the helper parameters from the hibernation image header
   109	 */
   110	int arch_hibernation_header_restore(void *addr)
   111	{
   112		struct arch_hibernate_hdr_invariants invariants;
   113		struct arch_hibernate_hdr *hdr = addr;
   114		int ret = 0;
   115	
   116		arch_hdr_invariants(&invariants);
   117	
   118		if (memcmp(&hdr->invariants, &invariants, sizeof(invariants))) {
   119			pr_crit("Hibernate image not generated by this kernel!\n");
   120			return -EINVAL;
   121		}
   122	
   123		sleep_cpu = riscv_hartid_to_cpuid(hdr->hartid);
   124		if (sleep_cpu < 0) {
   125			pr_crit("Hibernated on a CPU not known to this kernel!\n");
   126			sleep_cpu = -EINVAL;
   127			return -EINVAL;
   128		}
   129	
   130	#ifdef CONFIG_SMP
   131		ret = bringup_hibernate_cpu(sleep_cpu);
   132		if (ret) {
 > 133			sleep_cpu = -EINVAL;
   134			return ret;
   135		}
   136	#endif
 > 137		resume_hdr = *hdr;
   138	
   139		return ret;
   140	}
   141	EXPORT_SYMBOL(arch_hibernation_header_restore);
   142	

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



More information about the linux-riscv mailing list