Pull ACPI and power management fixes from Rafael Wysocki: "These include a fix for a recent intel_pstate regression, a fix for a regression in the ACPI-based PCI hotplug (ACPIPHP) code introduced during the 3.12 cycle, fixes for two bugs in the ACPI core introduced recently and a MAINTAINERS update related to cpufreq. Specifics: - Fix for a recent regression in the intel_pstate driver that introduced a race condition causing systems to crash during initialization in some situations. This removes the affected code altogether. From Dirk Brandewie. - ACPIPHP fix for a regression introduced during the 3.12 cycle causing devices to be dropped as a result of bus check notifications after system resume on some systems due to the way ACPIPHP interprets _STA return values (arguably incorrectly). From Mika Westerberg. - ACPI dock driver fix for a problem causing docking to fail due to a check that always fails after recent ACPI core changes (found by code inspection). - ACPI container driver fix to prevent memory from being leaked in an error code path after device_register() failures. - Update of the arm_big_little cpufreq driver maintainer's e-mail address" * tag 'pm+acpi-3.14-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: MAINTAINERS / cpufreq: update Sudeep's email address intel_pstate: Remove energy reporting from pstate_sample tracepoint ACPI / container: Fix error code path in container_device_attach() ACPI / hotplug / PCI: Relax the checking of _STA return values ACPI / dock: Use acpi_device_enumerated() to check if dock is present
Unified · Split
| @@ -2367,7 +2367,7 @@ F: include/linux/cpufreq.h · 2366 unmodified lines | ||
| 2367 | 2367 | |
| 2368 | 2368 | CPU FREQUENCY DRIVERS - ARM BIG LITTLE |
| 2369 | 2369 | M: Viresh Kumar <viresh.kumar@linaro.org> |
| 2370 | −M: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com> | |
| 2370 | +M: Sudeep Holla <sudeep.holla@arm.com> | |
| 2371 | 2371 | L: cpufreq@vger.kernel.org |
| 2372 | 2372 | L: linux-pm@vger.kernel.org |
| 2373 | 2373 | W: http://www.arm.com/products/processors/technologies/biglittleprocessing.php |
| @@ -79,9 +79,10 @@ static int container_device_attach(struct acpi_device *adev, · 78 unmodified lines | ||
| 79 | 79 | ACPI_COMPANION_SET(dev, adev); |
| 80 | 80 | dev->release = acpi_container_release; |
| 81 | 81 | ret = device_register(dev); |
| 82 | − if (ret) | |
| 82 | + if (ret) { | |
| 83 | + put_device(dev); | |
| 83 | 84 | return ret; |
| 84 | − | |
| 85 | + } | |
| 85 | 86 | adev->driver_data = dev; |
| 86 | 87 | return 1; |
| 87 | 88 | } |
| @@ -609,7 +609,7 @@ static int handle_eject_request(struct dock_station *ds, u32 event) · 608 unmodified lines | ||
| 609 | 609 | static void dock_notify(struct dock_station *ds, u32 event) |
| 610 | 610 | { |
| 611 | 611 | acpi_handle handle = ds->handle; |
| 612 | − struct acpi_device *ad; | |
| 612 | + struct acpi_device *adev = NULL; | |
| 613 | 613 | int surprise_removal = 0; |
| 614 | 614 | |
| 615 | 615 | /* |
| @@ -632,7 +632,8 @@ static void dock_notify(struct dock_station *ds, u32 event) · 16 unmodified lines | ||
| 632 | 632 | switch (event) { |
| 633 | 633 | case ACPI_NOTIFY_BUS_CHECK: |
| 634 | 634 | case ACPI_NOTIFY_DEVICE_CHECK: |
| 635 | − if (!dock_in_progress(ds) && acpi_bus_get_device(handle, &ad)) { | |
| 635 | + acpi_bus_get_device(handle, &adev); | |
| 636 | + if (!dock_in_progress(ds) && !acpi_device_enumerated(adev)) { | |
| 636 | 637 | begin_dock(ds); |
| 637 | 638 | dock(ds); |
| 638 | 639 | if (!dock_present(ds)) { |
| @@ -51,8 +51,6 @@ static inline int32_t div_fp(int32_t x, int32_t y) · 50 unmodified lines | ||
| 51 | 51 | return div_s64((int64_t)x << FRAC_BITS, (int64_t)y); |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | −static u64 energy_divisor; | |
| 55 | − | |
| 56 | 54 | struct sample { |
| 57 | 55 | int32_t core_pct_busy; |
| 58 | 56 | u64 aperf; |
| @@ -630,12 +628,10 @@ static void intel_pstate_timer_func(unsigned long __data) · 571 unmodified lines | ||
| 630 | 628 | { |
| 631 | 629 | struct cpudata *cpu = (struct cpudata *) __data; |
| 632 | 630 | struct sample *sample; |
| 633 | − u64 energy; | |
| 634 | 631 | |
| 635 | 632 | intel_pstate_sample(cpu); |
| 636 | 633 | |
| 637 | 634 | sample = &cpu->samples[cpu->sample_ptr]; |
| 638 | − rdmsrl(MSR_PKG_ENERGY_STATUS, energy); | |
| 639 | 635 | |
| 640 | 636 | intel_pstate_adjust_busy_pstate(cpu); |
| 641 | 637 | |
| @@ -644,7 +640,6 @@ static void intel_pstate_timer_func(unsigned long __data) · 2 unmodified lines | ||
| 644 | 640 | cpu->pstate.current_pstate, |
| 645 | 641 | sample->mperf, |
| 646 | 642 | sample->aperf, |
| 647 | − div64_u64(energy, energy_divisor), | |
| 648 | 643 | sample->freq); |
| 649 | 644 | |
| 650 | 645 | intel_pstate_set_sample_time(cpu); |
| @@ -926,7 +921,6 @@ static int __init intel_pstate_init(void) · 275 unmodified lines | ||
| 926 | 921 | int cpu, rc = 0; |
| 927 | 922 | const struct x86_cpu_id *id; |
| 928 | 923 | struct cpu_defaults *cpu_info; |
| 929 | − u64 units; | |
| 930 | 924 | |
| 931 | 925 | if (no_load) |
| 932 | 926 | return -ENODEV; |
| @@ -960,9 +954,6 @@ static int __init intel_pstate_init(void) · 27 unmodified lines | ||
| 960 | 954 | if (rc) |
| 961 | 955 | goto out; |
| 962 | 956 | |
| 963 | − rdmsrl(MSR_RAPL_POWER_UNIT, units); | |
| 964 | − energy_divisor = 1 << ((units >> 8) & 0x1f); /* bits{12:8} */ | |
| 965 | − | |
| 966 | 957 | intel_pstate_debug_expose_params(); |
| 967 | 958 | intel_pstate_sysfs_expose_params(); |
| 968 | 959 | |
| @@ -730,6 +730,17 @@ static unsigned int get_slot_status(struct acpiphp_slot *slot) · 729 unmodified lines | ||
| 730 | 730 | return (unsigned int)sta; |
| 731 | 731 | } |
| 732 | 732 | |
| 733 | +static inline bool device_status_valid(unsigned int sta) | |
| 734 | +{ | |
| 735 | + /* | |
| 736 | + * ACPI spec says that _STA may return bit 0 clear with bit 3 set | |
| 737 | + * if the device is valid but does not require a device driver to be | |
| 738 | + * loaded (Section 6.3.7 of ACPI 5.0A). | |
| 739 | + */ | |
| 740 | + unsigned int mask = ACPI_STA_DEVICE_ENABLED | ACPI_STA_DEVICE_FUNCTIONING; | |
| 741 | + return (sta & mask) == mask; | |
| 742 | +} | |
| 743 | + | |
| 733 | 744 | /** |
| 734 | 745 | * trim_stale_devices - remove PCI devices that are not responding. |
| 735 | 746 | * @dev: PCI device to start walking the hierarchy from. |
| @@ -745,7 +756,7 @@ static void trim_stale_devices(struct pci_dev *dev) · 9 unmodified lines | ||
| 745 | 756 | unsigned long long sta; |
| 746 | 757 | |
| 747 | 758 | status = acpi_evaluate_integer(handle, "_STA", NULL, &sta); |
| 748 | − alive = (ACPI_SUCCESS(status) && sta == ACPI_STA_ALL) | |
| 759 | + alive = (ACPI_SUCCESS(status) && device_status_valid(sta)) | |
| 749 | 760 | || acpiphp_no_hotplug(handle); |
| 750 | 761 | } |
| 751 | 762 | if (!alive) { |
| @@ -792,7 +803,7 @@ static void acpiphp_check_bridge(struct acpiphp_bridge *bridge) · 40 unmodified lines | ||
| 792 | 803 | mutex_lock(&slot->crit_sect); |
| 793 | 804 | if (slot_no_hotplug(slot)) { |
| 794 | 805 | ; /* do nothing */ |
| 795 | − } else if (get_slot_status(slot) == ACPI_STA_ALL) { | |
| 806 | + } else if (device_status_valid(get_slot_status(slot))) { | |
| 796 | 807 | /* remove stale devices if any */ |
| 797 | 808 | list_for_each_entry_safe_reverse(dev, tmp, |
| 798 | 809 | &bus->devices, bus_list) |
| @@ -42,7 +42,6 @@ TRACE_EVENT(pstate_sample, · 41 unmodified lines | ||
| 42 | 42 | u32 state, |
| 43 | 43 | u64 mperf, |
| 44 | 44 | u64 aperf, |
| 45 | − u32 energy, | |
| 46 | 45 | u32 freq |
| 47 | 46 | ), |
| 48 | 47 | |
| @@ -51,7 +50,6 @@ TRACE_EVENT(pstate_sample, · 2 unmodified lines | ||
| 51 | 50 | state, |
| 52 | 51 | mperf, |
| 53 | 52 | aperf, |
| 54 | − energy, | |
| 55 | 53 | freq |
| 56 | 54 | ), |
| 57 | 55 | |
| @@ -61,7 +59,6 @@ TRACE_EVENT(pstate_sample, · 3 unmodified lines | ||
| 61 | 59 | __field(u32, state) |
| 62 | 60 | __field(u64, mperf) |
| 63 | 61 | __field(u64, aperf) |
| 64 | − __field(u32, energy) | |
| 65 | 62 | __field(u32, freq) |
| 66 | 63 | |
| 67 | 64 | ), |
| @@ -72,17 +69,15 @@ TRACE_EVENT(pstate_sample, · 4 unmodified lines | ||
| 72 | 69 | __entry->state = state; |
| 73 | 70 | __entry->mperf = mperf; |
| 74 | 71 | __entry->aperf = aperf; |
| 75 | − __entry->energy = energy; | |
| 76 | 72 | __entry->freq = freq; |
| 77 | 73 | ), |
| 78 | 74 | |
| 79 | − TP_printk("core_busy=%lu scaled=%lu state=%lu mperf=%llu aperf=%llu energy=%lu freq=%lu ", | |
| 75 | + TP_printk("core_busy=%lu scaled=%lu state=%lu mperf=%llu aperf=%llu freq=%lu ", | |
| 80 | 76 | (unsigned long)__entry->core_busy, |
| 81 | 77 | (unsigned long)__entry->scaled_busy, |
| 82 | 78 | (unsigned long)__entry->state, |
| 83 | 79 | (unsigned long long)__entry->mperf, |
| 84 | 80 | (unsigned long long)__entry->aperf, |
| 85 | − (unsigned long)__entry->energy, | |
| 86 | 81 | (unsigned long)__entry->freq |
| 87 | 82 | ) |
| 88 | 83 | |