Hi Jiaxun, I love your patch! Yet something to improve: [auto build test ERROR on driver-core/driver-core-testing] [also build test ERROR on linus/master next-20200408] [cannot apply to tip/perf/core tip/irq/core v5.6] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest to use '--base' option to specify the base tree in git format-patch, please see https://stackoverflow.com/a/37406982] url: https://github.com/0day-ci/linux/commits/Jiaxun-Yang/MIPS-Topology-DeviceTree-CPU-rework/20200409-021602 base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git a10c9c710f9ecea87b9f4bbb837467893b4bef01 config: mips-allyesconfig (attached as .config) compiler: mips-linux-gcc (GCC) 9.3.0 reproduce: wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # save the attached .config to linux build tree GCC_VERSION=9.3.0 make.cross ARCH=mips If you fix the issue, kindly add following tag as appropriate Reported-by: kbuild test robot All errors (new ones prefixed by >>): drivers/cpuidle/cpuidle-cps.c: In function 'cps_nc_enter': >> drivers/cpuidle/cpuidle-cps.c:36:6: error: implicit declaration of function 'cpus_are_siblings' [-Werror=implicit-function-declaration] 36 | if (cpus_are_siblings(0, dev->cpu) && (index > STATE_NC_WAIT)) | ^~~~~~~~~~~~~~~~~ drivers/cpuidle/cpuidle-cps.c: In function 'cps_cpuidle_init': >> drivers/cpuidle/cpuidle-cps.c:162:40: error: 'cpu_sibling_map' undeclared (first use in this function); did you mean 'cpu_foreign_map'? 162 | cpumask_copy(&device->coupled_cpus, &cpu_sibling_map[cpu]); | ^~~~~~~~~~~~~~~ | cpu_foreign_map drivers/cpuidle/cpuidle-cps.c:162:40: note: each undeclared identifier is reported only once for each function it appears in cc1: some warnings being treated as errors vim +162 drivers/cpuidle/cpuidle-cps.c d050894435cdc78 Paul Burton 2014-04-14 22 d050894435cdc78 Paul Burton 2014-04-14 23 static int cps_nc_enter(struct cpuidle_device *dev, d050894435cdc78 Paul Burton 2014-04-14 24 struct cpuidle_driver *drv, int index) d050894435cdc78 Paul Burton 2014-04-14 25 { d050894435cdc78 Paul Burton 2014-04-14 26 enum cps_pm_state pm_state; d050894435cdc78 Paul Burton 2014-04-14 27 int err; d050894435cdc78 Paul Burton 2014-04-14 28 d050894435cdc78 Paul Burton 2014-04-14 29 /* d050894435cdc78 Paul Burton 2014-04-14 30 * At least one core must remain powered up & clocked in order for the d050894435cdc78 Paul Burton 2014-04-14 31 * system to have any hope of functioning. d050894435cdc78 Paul Burton 2014-04-14 32 * d050894435cdc78 Paul Burton 2014-04-14 33 * TODO: don't treat core 0 specially, just prevent the final core d050894435cdc78 Paul Burton 2014-04-14 34 * TODO: remap interrupt affinity temporarily d050894435cdc78 Paul Burton 2014-04-14 35 */ fe7a38c625a2ee3 Paul Burton 2017-08-12 @36 if (cpus_are_siblings(0, dev->cpu) && (index > STATE_NC_WAIT)) d050894435cdc78 Paul Burton 2014-04-14 37 index = STATE_NC_WAIT; d050894435cdc78 Paul Burton 2014-04-14 38 d050894435cdc78 Paul Burton 2014-04-14 39 /* Select the appropriate cps_pm_state */ d050894435cdc78 Paul Burton 2014-04-14 40 switch (index) { d050894435cdc78 Paul Burton 2014-04-14 41 case STATE_NC_WAIT: d050894435cdc78 Paul Burton 2014-04-14 42 pm_state = CPS_PM_NC_WAIT; d050894435cdc78 Paul Burton 2014-04-14 43 break; d050894435cdc78 Paul Burton 2014-04-14 44 case STATE_CLOCK_GATED: d050894435cdc78 Paul Burton 2014-04-14 45 pm_state = CPS_PM_CLOCK_GATED; d050894435cdc78 Paul Burton 2014-04-14 46 break; d050894435cdc78 Paul Burton 2014-04-14 47 case STATE_POWER_GATED: d050894435cdc78 Paul Burton 2014-04-14 48 pm_state = CPS_PM_POWER_GATED; d050894435cdc78 Paul Burton 2014-04-14 49 break; d050894435cdc78 Paul Burton 2014-04-14 50 default: d050894435cdc78 Paul Burton 2014-04-14 51 BUG(); d050894435cdc78 Paul Burton 2014-04-14 52 return -EINVAL; d050894435cdc78 Paul Burton 2014-04-14 53 } d050894435cdc78 Paul Burton 2014-04-14 54 d050894435cdc78 Paul Burton 2014-04-14 55 /* Notify listeners the CPU is about to power down */ d050894435cdc78 Paul Burton 2014-04-14 56 if ((pm_state == CPS_PM_POWER_GATED) && cpu_pm_enter()) d050894435cdc78 Paul Burton 2014-04-14 57 return -EINTR; d050894435cdc78 Paul Burton 2014-04-14 58 d050894435cdc78 Paul Burton 2014-04-14 59 /* Enter that state */ d050894435cdc78 Paul Burton 2014-04-14 60 err = cps_pm_enter_state(pm_state); d050894435cdc78 Paul Burton 2014-04-14 61 d050894435cdc78 Paul Burton 2014-04-14 62 /* Notify listeners the CPU is back up */ d050894435cdc78 Paul Burton 2014-04-14 63 if (pm_state == CPS_PM_POWER_GATED) d050894435cdc78 Paul Burton 2014-04-14 64 cpu_pm_exit(); d050894435cdc78 Paul Burton 2014-04-14 65 d050894435cdc78 Paul Burton 2014-04-14 66 return err ?: index; d050894435cdc78 Paul Burton 2014-04-14 67 } d050894435cdc78 Paul Burton 2014-04-14 68 d050894435cdc78 Paul Burton 2014-04-14 69 static struct cpuidle_driver cps_driver = { d050894435cdc78 Paul Burton 2014-04-14 70 .name = "cpc_cpuidle", d050894435cdc78 Paul Burton 2014-04-14 71 .owner = THIS_MODULE, d050894435cdc78 Paul Burton 2014-04-14 72 .states = { d050894435cdc78 Paul Burton 2014-04-14 73 [STATE_WAIT] = MIPS_CPUIDLE_WAIT_STATE, d050894435cdc78 Paul Burton 2014-04-14 74 [STATE_NC_WAIT] = { d050894435cdc78 Paul Burton 2014-04-14 75 .enter = cps_nc_enter, d050894435cdc78 Paul Burton 2014-04-14 76 .exit_latency = 200, d050894435cdc78 Paul Burton 2014-04-14 77 .target_residency = 450, d050894435cdc78 Paul Burton 2014-04-14 78 .name = "nc-wait", d050894435cdc78 Paul Burton 2014-04-14 79 .desc = "non-coherent MIPS wait", d050894435cdc78 Paul Burton 2014-04-14 80 }, d050894435cdc78 Paul Burton 2014-04-14 81 [STATE_CLOCK_GATED] = { d050894435cdc78 Paul Burton 2014-04-14 82 .enter = cps_nc_enter, d050894435cdc78 Paul Burton 2014-04-14 83 .exit_latency = 300, d050894435cdc78 Paul Burton 2014-04-14 84 .target_residency = 700, b82b6cca488074d Daniel Lezcano 2014-11-12 85 .flags = CPUIDLE_FLAG_TIMER_STOP, d050894435cdc78 Paul Burton 2014-04-14 86 .name = "clock-gated", d050894435cdc78 Paul Burton 2014-04-14 87 .desc = "core clock gated", d050894435cdc78 Paul Burton 2014-04-14 88 }, d050894435cdc78 Paul Burton 2014-04-14 89 [STATE_POWER_GATED] = { d050894435cdc78 Paul Burton 2014-04-14 90 .enter = cps_nc_enter, d050894435cdc78 Paul Burton 2014-04-14 91 .exit_latency = 600, d050894435cdc78 Paul Burton 2014-04-14 92 .target_residency = 1000, b82b6cca488074d Daniel Lezcano 2014-11-12 93 .flags = CPUIDLE_FLAG_TIMER_STOP, d050894435cdc78 Paul Burton 2014-04-14 94 .name = "power-gated", d050894435cdc78 Paul Burton 2014-04-14 95 .desc = "core power gated", d050894435cdc78 Paul Burton 2014-04-14 96 }, d050894435cdc78 Paul Burton 2014-04-14 97 }, d050894435cdc78 Paul Burton 2014-04-14 98 .state_count = STATE_COUNT, d050894435cdc78 Paul Burton 2014-04-14 99 .safe_state_index = 0, d050894435cdc78 Paul Burton 2014-04-14 100 }; d050894435cdc78 Paul Burton 2014-04-14 101 d050894435cdc78 Paul Burton 2014-04-14 102 static void __init cps_cpuidle_unregister(void) d050894435cdc78 Paul Burton 2014-04-14 103 { d050894435cdc78 Paul Burton 2014-04-14 104 int cpu; d050894435cdc78 Paul Burton 2014-04-14 105 struct cpuidle_device *device; d050894435cdc78 Paul Burton 2014-04-14 106 d050894435cdc78 Paul Burton 2014-04-14 107 for_each_possible_cpu(cpu) { d050894435cdc78 Paul Burton 2014-04-14 108 device = &per_cpu(cpuidle_dev, cpu); d050894435cdc78 Paul Burton 2014-04-14 109 cpuidle_unregister_device(device); d050894435cdc78 Paul Burton 2014-04-14 110 } d050894435cdc78 Paul Burton 2014-04-14 111 d050894435cdc78 Paul Burton 2014-04-14 112 cpuidle_unregister_driver(&cps_driver); d050894435cdc78 Paul Burton 2014-04-14 113 } d050894435cdc78 Paul Burton 2014-04-14 114 d050894435cdc78 Paul Burton 2014-04-14 115 static int __init cps_cpuidle_init(void) d050894435cdc78 Paul Burton 2014-04-14 116 { 02018b3929a23ac Marcin Nowakowski 2017-04-19 117 int err, cpu, i; d050894435cdc78 Paul Burton 2014-04-14 118 struct cpuidle_device *device; d050894435cdc78 Paul Burton 2014-04-14 119 d050894435cdc78 Paul Burton 2014-04-14 120 /* Detect supported states */ d050894435cdc78 Paul Burton 2014-04-14 121 if (!cps_pm_support_state(CPS_PM_POWER_GATED)) d050894435cdc78 Paul Burton 2014-04-14 122 cps_driver.state_count = STATE_CLOCK_GATED + 1; d050894435cdc78 Paul Burton 2014-04-14 123 if (!cps_pm_support_state(CPS_PM_CLOCK_GATED)) d050894435cdc78 Paul Burton 2014-04-14 124 cps_driver.state_count = STATE_NC_WAIT + 1; d050894435cdc78 Paul Burton 2014-04-14 125 if (!cps_pm_support_state(CPS_PM_NC_WAIT)) d050894435cdc78 Paul Burton 2014-04-14 126 cps_driver.state_count = STATE_WAIT + 1; d050894435cdc78 Paul Burton 2014-04-14 127 d050894435cdc78 Paul Burton 2014-04-14 128 /* Inform the user if some states are unavailable */ d050894435cdc78 Paul Burton 2014-04-14 129 if (cps_driver.state_count < STATE_COUNT) { d050894435cdc78 Paul Burton 2014-04-14 130 pr_info("cpuidle-cps: limited to "); d050894435cdc78 Paul Burton 2014-04-14 131 switch (cps_driver.state_count - 1) { d050894435cdc78 Paul Burton 2014-04-14 132 case STATE_WAIT: d050894435cdc78 Paul Burton 2014-04-14 133 pr_cont("coherent wait\n"); d050894435cdc78 Paul Burton 2014-04-14 134 break; d050894435cdc78 Paul Burton 2014-04-14 135 case STATE_NC_WAIT: d050894435cdc78 Paul Burton 2014-04-14 136 pr_cont("non-coherent wait\n"); d050894435cdc78 Paul Burton 2014-04-14 137 break; d050894435cdc78 Paul Burton 2014-04-14 138 case STATE_CLOCK_GATED: d050894435cdc78 Paul Burton 2014-04-14 139 pr_cont("clock gating\n"); d050894435cdc78 Paul Burton 2014-04-14 140 break; d050894435cdc78 Paul Burton 2014-04-14 141 } d050894435cdc78 Paul Burton 2014-04-14 142 } d050894435cdc78 Paul Burton 2014-04-14 143 d050894435cdc78 Paul Burton 2014-04-14 144 /* d050894435cdc78 Paul Burton 2014-04-14 145 * Set the coupled flag on the appropriate states if this system d050894435cdc78 Paul Burton 2014-04-14 146 * requires it. d050894435cdc78 Paul Burton 2014-04-14 147 */ d050894435cdc78 Paul Burton 2014-04-14 148 if (coupled_coherence) d050894435cdc78 Paul Burton 2014-04-14 149 for (i = STATE_NC_WAIT; i < cps_driver.state_count; i++) d050894435cdc78 Paul Burton 2014-04-14 150 cps_driver.states[i].flags |= CPUIDLE_FLAG_COUPLED; d050894435cdc78 Paul Burton 2014-04-14 151 d050894435cdc78 Paul Burton 2014-04-14 152 err = cpuidle_register_driver(&cps_driver); d050894435cdc78 Paul Burton 2014-04-14 153 if (err) { d050894435cdc78 Paul Burton 2014-04-14 154 pr_err("Failed to register CPS cpuidle driver\n"); d050894435cdc78 Paul Burton 2014-04-14 155 return err; d050894435cdc78 Paul Burton 2014-04-14 156 } d050894435cdc78 Paul Burton 2014-04-14 157 d050894435cdc78 Paul Burton 2014-04-14 158 for_each_possible_cpu(cpu) { d050894435cdc78 Paul Burton 2014-04-14 159 device = &per_cpu(cpuidle_dev, cpu); d050894435cdc78 Paul Burton 2014-04-14 160 device->cpu = cpu; 72bc8c75eaf72aa Matt Redfearn 2016-09-07 161 #ifdef CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED d050894435cdc78 Paul Burton 2014-04-14 @162 cpumask_copy(&device->coupled_cpus, &cpu_sibling_map[cpu]); :::::: The code at line 162 was first introduced by commit :::::: d050894435cdc78807e714a0148527542a583e87 cpuidle: cpuidle-cps: add MIPS CPS cpuidle driver :::::: TO: Paul Burton :::::: CC: Paul Burton --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org