Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux

Pull ACPI and Power Management changes from Len Brown.

This does an evil merge to fix up what I think is a mismerge by Len to
the gma500 driver, and restore it to the mainline state.

In that driver, both branches had commented out the call to
acpi_video_register(), and Len resolved the merge to that commented-out
version.

However, in mainline, further changes by Alan (commit d839ede47a56:
"gma500: opregion and ACPI" to be exact) had re-enabled the ACPI video
registration, so the current state of the driver seems to want it.

Alan is apparently still feeling the effects of partying with the Queen,
so he didn't reply to my query, but I'll do the evil merge anyway.

* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux:
ACPI: fix acpi_bus.h build warnings when ACPI is not enabled
drivers: acpi: Fix dependency for ACPI_HOTPLUG_CPU
tools/power turbostat: fix IVB support
tools/power turbostat: fix un-intended affinity of forked program
ACPI video: use after input_unregister_device()
gma500: don't register the ACPI video bus
acpi_video: Intel video is not always i915
acpi_video: fix leaking PCI references
ACPI: Ignore invalid _PSS entries, but use valid ones
ACPI battery: only refresh the sysfs files when pertinent information changes

+87 -22
+1 -1
drivers/acpi/Kconfig
··· 208 208 209 209 config ACPI_HOTPLUG_CPU 210 210 bool 211 - depends on ACPI_PROCESSOR && HOTPLUG_CPU 211 + depends on EXPERIMENTAL && ACPI_PROCESSOR && HOTPLUG_CPU 212 212 select ACPI_CONTAINER 213 213 default y 214 214
+9 -1
drivers/acpi/battery.c
··· 643 643 644 644 static void acpi_battery_refresh(struct acpi_battery *battery) 645 645 { 646 + int power_unit; 647 + 646 648 if (!battery->bat.dev) 647 649 return; 648 650 651 + power_unit = battery->power_unit; 652 + 649 653 acpi_battery_get_info(battery); 650 - /* The battery may have changed its reporting units. */ 654 + 655 + if (power_unit == battery->power_unit) 656 + return; 657 + 658 + /* The battery has changed its reporting units. */ 651 659 sysfs_remove_battery(battery); 652 660 sysfs_add_battery(battery); 653 661 }
+25 -5
drivers/acpi/processor_perflib.c
··· 333 333 struct acpi_buffer state = { 0, NULL }; 334 334 union acpi_object *pss = NULL; 335 335 int i; 336 + int last_invalid = -1; 336 337 337 338 338 339 status = acpi_evaluate_object(pr->handle, "_PSS", NULL, &buffer); ··· 395 394 ((u32)(px->core_frequency * 1000) != 396 395 (px->core_frequency * 1000))) { 397 396 printk(KERN_ERR FW_BUG PREFIX 398 - "Invalid BIOS _PSS frequency: 0x%llx MHz\n", 399 - px->core_frequency); 400 - result = -EFAULT; 401 - kfree(pr->performance->states); 402 - goto end; 397 + "Invalid BIOS _PSS frequency found for processor %d: 0x%llx MHz\n", 398 + pr->id, px->core_frequency); 399 + if (last_invalid == -1) 400 + last_invalid = i; 401 + } else { 402 + if (last_invalid != -1) { 403 + /* 404 + * Copy this valid entry over last_invalid entry 405 + */ 406 + memcpy(&(pr->performance->states[last_invalid]), 407 + px, sizeof(struct acpi_processor_px)); 408 + ++last_invalid; 409 + } 403 410 } 404 411 } 412 + 413 + if (last_invalid == 0) { 414 + printk(KERN_ERR FW_BUG PREFIX 415 + "No valid BIOS _PSS frequency found for processor %d\n", pr->id); 416 + result = -EFAULT; 417 + kfree(pr->performance->states); 418 + pr->performance->states = NULL; 419 + } 420 + 421 + if (last_invalid > 0) 422 + pr->performance->state_count = last_invalid; 405 423 406 424 end: 407 425 kfree(buffer.pointer);
+22 -11
drivers/acpi/video.c
··· 1687 1687 set_bit(KEY_BRIGHTNESS_ZERO, input->keybit); 1688 1688 set_bit(KEY_DISPLAY_OFF, input->keybit); 1689 1689 1690 - error = input_register_device(input); 1691 - if (error) 1692 - goto err_stop_video; 1693 - 1694 1690 printk(KERN_INFO PREFIX "%s [%s] (multi-head: %s rom: %s post: %s)\n", 1695 1691 ACPI_VIDEO_DEVICE_NAME, acpi_device_bid(device), 1696 1692 video->flags.multihead ? "yes" : "no", ··· 1697 1701 video->pm_nb.priority = 0; 1698 1702 error = register_pm_notifier(&video->pm_nb); 1699 1703 if (error) 1700 - goto err_unregister_input_dev; 1704 + goto err_stop_video; 1705 + 1706 + error = input_register_device(input); 1707 + if (error) 1708 + goto err_unregister_pm_notifier; 1701 1709 1702 1710 return 0; 1703 1711 1704 - err_unregister_input_dev: 1705 - input_unregister_device(input); 1712 + err_unregister_pm_notifier: 1713 + unregister_pm_notifier(&video->pm_nb); 1706 1714 err_stop_video: 1707 1715 acpi_video_bus_stop_devices(video); 1708 1716 err_free_input_dev: ··· 1743 1743 return 0; 1744 1744 } 1745 1745 1746 + static int __init is_i740(struct pci_dev *dev) 1747 + { 1748 + if (dev->device == 0x00D1) 1749 + return 1; 1750 + if (dev->device == 0x7000) 1751 + return 1; 1752 + return 0; 1753 + } 1754 + 1746 1755 static int __init intel_opregion_present(void) 1747 1756 { 1748 - #if defined(CONFIG_DRM_I915) || defined(CONFIG_DRM_I915_MODULE) 1757 + int opregion = 0; 1749 1758 struct pci_dev *dev = NULL; 1750 1759 u32 address; 1751 1760 ··· 1763 1754 continue; 1764 1755 if (dev->vendor != PCI_VENDOR_ID_INTEL) 1765 1756 continue; 1757 + /* We don't want to poke around undefined i740 registers */ 1758 + if (is_i740(dev)) 1759 + continue; 1766 1760 pci_read_config_dword(dev, 0xfc, &address); 1767 1761 if (!address) 1768 1762 continue; 1769 - return 1; 1763 + opregion = 1; 1770 1764 } 1771 - #endif 1772 - return 0; 1765 + return opregion; 1773 1766 } 1774 1767 1775 1768 int acpi_video_register(void)
+2 -2
include/acpi/acpi_bus.h
··· 440 440 441 441 #else /* CONFIG_ACPI */ 442 442 443 - static int register_acpi_bus_type(struct acpi_bus_type *bus) { return 0; } 444 - static int unregister_acpi_bus_type(struct acpi_bus_type *bus) { return 0; } 443 + static inline int register_acpi_bus_type(void *bus) { return 0; } 444 + static inline int unregister_acpi_bus_type(void *bus) { return 0; } 445 445 446 446 #endif /* CONFIG_ACPI */ 447 447
+28 -2
tools/power/x86/turbostat/turbostat.c
··· 73 73 char *progname; 74 74 75 75 int num_cpus; 76 - cpu_set_t *cpu_mask; 77 - size_t cpu_mask_size; 76 + cpu_set_t *cpu_present_set, *cpu_mask; 77 + size_t cpu_present_setsize, cpu_mask_size; 78 78 79 79 struct counters { 80 80 unsigned long long tsc; /* per thread */ ··· 103 103 struct timeval tv_odd; 104 104 struct timeval tv_delta; 105 105 106 + int mark_cpu_present(int pkg, int core, int cpu) 107 + { 108 + CPU_SET_S(cpu, cpu_present_setsize, cpu_present_set); 109 + return 0; 110 + } 111 + 106 112 /* 107 113 * cpu_mask_init(ncpus) 108 114 * ··· 124 118 } 125 119 cpu_mask_size = CPU_ALLOC_SIZE(ncpus); 126 120 CPU_ZERO_S(cpu_mask_size, cpu_mask); 121 + 122 + /* 123 + * Allocate and initialize cpu_present_set 124 + */ 125 + cpu_present_set = CPU_ALLOC(ncpus); 126 + if (cpu_present_set == NULL) { 127 + perror("CPU_ALLOC"); 128 + exit(3); 129 + } 130 + cpu_present_setsize = CPU_ALLOC_SIZE(ncpus); 131 + CPU_ZERO_S(cpu_present_setsize, cpu_present_set); 132 + for_all_cpus(mark_cpu_present); 127 133 } 128 134 129 135 void cpu_mask_uninit() ··· 143 125 CPU_FREE(cpu_mask); 144 126 cpu_mask = NULL; 145 127 cpu_mask_size = 0; 128 + CPU_FREE(cpu_present_set); 129 + cpu_present_set = NULL; 130 + cpu_present_setsize = 0; 146 131 } 147 132 148 133 int cpu_migrate(int cpu) ··· 933 912 switch (model) { 934 913 case 0x2A: 935 914 case 0x2D: 915 + case 0x3A: /* IVB */ 916 + case 0x3D: /* IVB Xeon */ 936 917 return 1; 937 918 } 938 919 return 0; ··· 1070 1047 int retval; 1071 1048 pid_t child_pid; 1072 1049 get_counters(cnt_even); 1050 + 1051 + /* clear affinity side-effect of get_counters() */ 1052 + sched_setaffinity(0, cpu_present_setsize, cpu_present_set); 1073 1053 gettimeofday(&tv_even, (struct timezone *)NULL); 1074 1054 1075 1055 child_pid = fork();