arch/x86/kernel/apm_32.c:2392: undefined reference to `cpuidle_poll_state_init'
From: kbuild test robot
Date: Sun Feb 11 2018 - 19:36:58 EST
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 7928b2cbe55b2a410a0f5c1f154610059c57b1b2
commit: f859422075165e32c00c8d75d63f300015cc07ae x86: PM: Make APM idle driver initialize polling state
date: 5 days ago
config: i386-randconfig-x074-201806 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
git checkout f859422075165e32c00c8d75d63f300015cc07ae
# save the attached .config to linux build tree
make ARCH=i386
All errors (new ones prefixed by >>):
arch/x86/kernel/apm_32.o: In function `apm_init':
>> arch/x86/kernel/apm_32.c:2392: undefined reference to `cpuidle_poll_state_init'
vim +2392 arch/x86/kernel/apm_32.c
2256
2257 /*
2258 * Just start the APM thread. We do NOT want to do APM BIOS
2259 * calls from anything but the APM thread, if for no other reason
2260 * than the fact that we don't trust the APM BIOS. This way,
2261 * most common APM BIOS problems that lead to protection errors
2262 * etc will have at least some level of being contained...
2263 *
2264 * In short, if something bad happens, at least we have a choice
2265 * of just killing the apm thread..
2266 */
2267 static int __init apm_init(void)
2268 {
2269 struct desc_struct *gdt;
2270 int err;
2271
2272 dmi_check_system(apm_dmi_table);
2273
2274 if (apm_info.bios.version == 0 || machine_is_olpc()) {
2275 printk(KERN_INFO "apm: BIOS not found.\n");
2276 return -ENODEV;
2277 }
2278 printk(KERN_INFO
2279 "apm: BIOS version %d.%d Flags 0x%02x (Driver version %s)\n",
2280 ((apm_info.bios.version >> 8) & 0xff),
2281 (apm_info.bios.version & 0xff),
2282 apm_info.bios.flags,
2283 driver_version);
2284 if ((apm_info.bios.flags & APM_32_BIT_SUPPORT) == 0) {
2285 printk(KERN_INFO "apm: no 32 bit BIOS support\n");
2286 return -ENODEV;
2287 }
2288
2289 if (allow_ints)
2290 apm_info.allow_ints = 1;
2291 if (broken_psr)
2292 apm_info.get_power_status_broken = 1;
2293 if (realmode_power_off)
2294 apm_info.realmode_power_off = 1;
2295 /* User can override, but default is to trust DMI */
2296 if (apm_disabled != -1)
2297 apm_info.disabled = apm_disabled;
2298
2299 /*
2300 * Fix for the Compaq Contura 3/25c which reports BIOS version 0.1
2301 * but is reportedly a 1.0 BIOS.
2302 */
2303 if (apm_info.bios.version == 0x001)
2304 apm_info.bios.version = 0x100;
2305
2306 /* BIOS < 1.2 doesn't set cseg_16_len */
2307 if (apm_info.bios.version < 0x102)
2308 apm_info.bios.cseg_16_len = 0; /* 64k */
2309
2310 if (debug) {
2311 printk(KERN_INFO "apm: entry %x:%x cseg16 %x dseg %x",
2312 apm_info.bios.cseg, apm_info.bios.offset,
2313 apm_info.bios.cseg_16, apm_info.bios.dseg);
2314 if (apm_info.bios.version > 0x100)
2315 printk(" cseg len %x, dseg len %x",
2316 apm_info.bios.cseg_len,
2317 apm_info.bios.dseg_len);
2318 if (apm_info.bios.version > 0x101)
2319 printk(" cseg16 len %x", apm_info.bios.cseg_16_len);
2320 printk("\n");
2321 }
2322
2323 if (apm_info.disabled) {
2324 pr_notice("disabled on user request.\n");
2325 return -ENODEV;
2326 }
2327 if ((num_online_cpus() > 1) && !power_off && !smp) {
2328 pr_notice("disabled - APM is not SMP safe.\n");
2329 apm_info.disabled = 1;
2330 return -ENODEV;
2331 }
2332 if (!acpi_disabled) {
2333 pr_notice("overridden by ACPI.\n");
2334 apm_info.disabled = 1;
2335 return -ENODEV;
2336 }
2337
2338 /*
2339 * Set up the long jump entry point to the APM BIOS, which is called
2340 * from inline assembly.
2341 */
2342 apm_bios_entry.offset = apm_info.bios.offset;
2343 apm_bios_entry.segment = APM_CS;
2344
2345 /*
2346 * The APM 1.1 BIOS is supposed to provide limit information that it
2347 * recognizes. Many machines do this correctly, but many others do
2348 * not restrict themselves to their claimed limit. When this happens,
2349 * they will cause a segmentation violation in the kernel at boot time.
2350 * Most BIOS's, however, will respect a 64k limit, so we use that.
2351 *
2352 * Note we only set APM segments on CPU zero, since we pin the APM
2353 * code to that CPU.
2354 */
2355 gdt = get_cpu_gdt_rw(0);
2356 set_desc_base(&gdt[APM_CS >> 3],
2357 (unsigned long)__va((unsigned long)apm_info.bios.cseg << 4));
2358 set_desc_base(&gdt[APM_CS_16 >> 3],
2359 (unsigned long)__va((unsigned long)apm_info.bios.cseg_16 << 4));
2360 set_desc_base(&gdt[APM_DS >> 3],
2361 (unsigned long)__va((unsigned long)apm_info.bios.dseg << 4));
2362
2363 proc_create("apm", 0, NULL, &apm_file_ops);
2364
2365 kapmd_task = kthread_create(apm, NULL, "kapmd");
2366 if (IS_ERR(kapmd_task)) {
2367 pr_err("disabled - Unable to start kernel thread\n");
2368 err = PTR_ERR(kapmd_task);
2369 kapmd_task = NULL;
2370 remove_proc_entry("apm", NULL);
2371 return err;
2372 }
2373 wake_up_process(kapmd_task);
2374
2375 if (num_online_cpus() > 1 && !smp) {
2376 printk(KERN_NOTICE
2377 "apm: disabled - APM is not SMP safe (power off active).\n");
2378 return 0;
2379 }
2380
2381 /*
2382 * Note we don't actually care if the misc_device cannot be registered.
2383 * this driver can do its job without it, even if userspace can't
2384 * control it. just log the error
2385 */
2386 if (misc_register(&apm_device))
2387 printk(KERN_WARNING "apm: Could not register misc device.\n");
2388
2389 if (HZ != 100)
2390 idle_period = (idle_period * HZ) / 100;
2391 if (idle_threshold < 100) {
> 2392 cpuidle_poll_state_init(&apm_idle_driver);
2393 if (!cpuidle_register_driver(&apm_idle_driver))
2394 if (cpuidle_register_device(&apm_cpuidle_device))
2395 cpuidle_unregister_driver(&apm_idle_driver);
2396 }
2397
2398 return 0;
2399 }
2400
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
Attachment:
.config.gz
Description: application/gzip