aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-02-14 14:07:29 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2014-02-14 14:07:29 -0500
commiteef445eedcd80aa4f3646cecf285cf934d264eb6 (patch)
tree87bb5190f39da95ca55f3ab5248c30bfc4ca4f0b
parent3bd354abe17f2c8aa426ef84b78f14e505f0a920 (diff)
parent465e5fc41dbeeb5331bbff6e9e734f0542dfc739 (diff)
Merge tag 'pm+acpi-3.14-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
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
-rw-r--r--MAINTAINERS2
-rw-r--r--drivers/acpi/container.c5
-rw-r--r--drivers/acpi/dock.c5
-rw-r--r--drivers/cpufreq/intel_pstate.c9
-rw-r--r--drivers/pci/hotplug/acpiphp_glue.c15
-rw-r--r--include/trace/events/power.h7
6 files changed, 21 insertions, 22 deletions
diff --git a/MAINTAINERS b/MAINTAINERS
index fee5e94b0d5e..fb08dcececf1 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2367,7 +2367,7 @@ F: include/linux/cpufreq.h
2367 2367
2368CPU FREQUENCY DRIVERS - ARM BIG LITTLE 2368CPU FREQUENCY DRIVERS - ARM BIG LITTLE
2369M: Viresh Kumar <viresh.kumar@linaro.org> 2369M: Viresh Kumar <viresh.kumar@linaro.org>
2370M: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com> 2370M: Sudeep Holla <sudeep.holla@arm.com>
2371L: cpufreq@vger.kernel.org 2371L: cpufreq@vger.kernel.org
2372L: linux-pm@vger.kernel.org 2372L: linux-pm@vger.kernel.org
2373W: http://www.arm.com/products/processors/technologies/biglittleprocessing.php 2373W: http://www.arm.com/products/processors/technologies/biglittleprocessing.php
diff --git a/drivers/acpi/container.c b/drivers/acpi/container.c
index 0b6ae6eb5c4a..368f9ddb8480 100644
--- a/drivers/acpi/container.c
+++ b/drivers/acpi/container.c
@@ -79,9 +79,10 @@ static int container_device_attach(struct acpi_device *adev,
79 ACPI_COMPANION_SET(dev, adev); 79 ACPI_COMPANION_SET(dev, adev);
80 dev->release = acpi_container_release; 80 dev->release = acpi_container_release;
81 ret = device_register(dev); 81 ret = device_register(dev);
82 if (ret) 82 if (ret) {
83 put_device(dev);
83 return ret; 84 return ret;
84 85 }
85 adev->driver_data = dev; 86 adev->driver_data = dev;
86 return 1; 87 return 1;
87} 88}
diff --git a/drivers/acpi/dock.c b/drivers/acpi/dock.c
index c431c88faaff..e9b3081c4fe9 100644
--- a/drivers/acpi/dock.c
+++ b/drivers/acpi/dock.c
@@ -609,7 +609,7 @@ static int handle_eject_request(struct dock_station *ds, u32 event)
609static void dock_notify(struct dock_station *ds, u32 event) 609static void dock_notify(struct dock_station *ds, u32 event)
610{ 610{
611 acpi_handle handle = ds->handle; 611 acpi_handle handle = ds->handle;
612 struct acpi_device *ad; 612 struct acpi_device *adev = NULL;
613 int surprise_removal = 0; 613 int surprise_removal = 0;
614 614
615 /* 615 /*
@@ -632,7 +632,8 @@ static void dock_notify(struct dock_station *ds, u32 event)
632 switch (event) { 632 switch (event) {
633 case ACPI_NOTIFY_BUS_CHECK: 633 case ACPI_NOTIFY_BUS_CHECK:
634 case ACPI_NOTIFY_DEVICE_CHECK: 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 begin_dock(ds); 637 begin_dock(ds);
637 dock(ds); 638 dock(ds);
638 if (!dock_present(ds)) { 639 if (!dock_present(ds)) {
diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
index 79606f473f48..c788abf1c457 100644
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -51,8 +51,6 @@ static inline int32_t div_fp(int32_t x, int32_t y)
51 return div_s64((int64_t)x << FRAC_BITS, (int64_t)y); 51 return div_s64((int64_t)x << FRAC_BITS, (int64_t)y);
52} 52}
53 53
54static u64 energy_divisor;
55
56struct sample { 54struct sample {
57 int32_t core_pct_busy; 55 int32_t core_pct_busy;
58 u64 aperf; 56 u64 aperf;
@@ -630,12 +628,10 @@ static void intel_pstate_timer_func(unsigned long __data)
630{ 628{
631 struct cpudata *cpu = (struct cpudata *) __data; 629 struct cpudata *cpu = (struct cpudata *) __data;
632 struct sample *sample; 630 struct sample *sample;
633 u64 energy;
634 631
635 intel_pstate_sample(cpu); 632 intel_pstate_sample(cpu);
636 633
637 sample = &cpu->samples[cpu->sample_ptr]; 634 sample = &cpu->samples[cpu->sample_ptr];
638 rdmsrl(MSR_PKG_ENERGY_STATUS, energy);
639 635
640 intel_pstate_adjust_busy_pstate(cpu); 636 intel_pstate_adjust_busy_pstate(cpu);
641 637
@@ -644,7 +640,6 @@ static void intel_pstate_timer_func(unsigned long __data)
644 cpu->pstate.current_pstate, 640 cpu->pstate.current_pstate,
645 sample->mperf, 641 sample->mperf,
646 sample->aperf, 642 sample->aperf,
647 div64_u64(energy, energy_divisor),
648 sample->freq); 643 sample->freq);
649 644
650 intel_pstate_set_sample_time(cpu); 645 intel_pstate_set_sample_time(cpu);
@@ -926,7 +921,6 @@ static int __init intel_pstate_init(void)
926 int cpu, rc = 0; 921 int cpu, rc = 0;
927 const struct x86_cpu_id *id; 922 const struct x86_cpu_id *id;
928 struct cpu_defaults *cpu_info; 923 struct cpu_defaults *cpu_info;
929 u64 units;
930 924
931 if (no_load) 925 if (no_load)
932 return -ENODEV; 926 return -ENODEV;
@@ -960,9 +954,6 @@ static int __init intel_pstate_init(void)
960 if (rc) 954 if (rc)
961 goto out; 955 goto out;
962 956
963 rdmsrl(MSR_RAPL_POWER_UNIT, units);
964 energy_divisor = 1 << ((units >> 8) & 0x1f); /* bits{12:8} */
965
966 intel_pstate_debug_expose_params(); 957 intel_pstate_debug_expose_params();
967 intel_pstate_sysfs_expose_params(); 958 intel_pstate_sysfs_expose_params();
968 959
diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
index e2a783fdb98f..7c7a388c85ab 100644
--- a/drivers/pci/hotplug/acpiphp_glue.c
+++ b/drivers/pci/hotplug/acpiphp_glue.c
@@ -730,6 +730,17 @@ static unsigned int get_slot_status(struct acpiphp_slot *slot)
730 return (unsigned int)sta; 730 return (unsigned int)sta;
731} 731}
732 732
733static 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 * trim_stale_devices - remove PCI devices that are not responding. 745 * trim_stale_devices - remove PCI devices that are not responding.
735 * @dev: PCI device to start walking the hierarchy from. 746 * @dev: PCI device to start walking the hierarchy from.
@@ -745,7 +756,7 @@ static void trim_stale_devices(struct pci_dev *dev)
745 unsigned long long sta; 756 unsigned long long sta;
746 757
747 status = acpi_evaluate_integer(handle, "_STA", NULL, &sta); 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 || acpiphp_no_hotplug(handle); 760 || acpiphp_no_hotplug(handle);
750 } 761 }
751 if (!alive) { 762 if (!alive) {
@@ -792,7 +803,7 @@ static void acpiphp_check_bridge(struct acpiphp_bridge *bridge)
792 mutex_lock(&slot->crit_sect); 803 mutex_lock(&slot->crit_sect);
793 if (slot_no_hotplug(slot)) { 804 if (slot_no_hotplug(slot)) {
794 ; /* do nothing */ 805 ; /* do nothing */
795 } else if (get_slot_status(slot) == ACPI_STA_ALL) { 806 } else if (device_status_valid(get_slot_status(slot))) {
796 /* remove stale devices if any */ 807 /* remove stale devices if any */
797 list_for_each_entry_safe_reverse(dev, tmp, 808 list_for_each_entry_safe_reverse(dev, tmp,
798 &bus->devices, bus_list) 809 &bus->devices, bus_list)
diff --git a/include/trace/events/power.h b/include/trace/events/power.h
index 9e9475c85de5..e5bf9a76f169 100644
--- a/include/trace/events/power.h
+++ b/include/trace/events/power.h
@@ -42,7 +42,6 @@ TRACE_EVENT(pstate_sample,
42 u32 state, 42 u32 state,
43 u64 mperf, 43 u64 mperf,
44 u64 aperf, 44 u64 aperf,
45 u32 energy,
46 u32 freq 45 u32 freq
47 ), 46 ),
48 47
@@ -51,7 +50,6 @@ TRACE_EVENT(pstate_sample,
51 state, 50 state,
52 mperf, 51 mperf,
53 aperf, 52 aperf,
54 energy,
55 freq 53 freq
56 ), 54 ),
57 55
@@ -61,7 +59,6 @@ TRACE_EVENT(pstate_sample,
61 __field(u32, state) 59 __field(u32, state)
62 __field(u64, mperf) 60 __field(u64, mperf)
63 __field(u64, aperf) 61 __field(u64, aperf)
64 __field(u32, energy)
65 __field(u32, freq) 62 __field(u32, freq)
66 63
67 ), 64 ),
@@ -72,17 +69,15 @@ TRACE_EVENT(pstate_sample,
72 __entry->state = state; 69 __entry->state = state;
73 __entry->mperf = mperf; 70 __entry->mperf = mperf;
74 __entry->aperf = aperf; 71 __entry->aperf = aperf;
75 __entry->energy = energy;
76 __entry->freq = freq; 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 (unsigned long)__entry->core_busy, 76 (unsigned long)__entry->core_busy,
81 (unsigned long)__entry->scaled_busy, 77 (unsigned long)__entry->scaled_busy,
82 (unsigned long)__entry->state, 78 (unsigned long)__entry->state,
83 (unsigned long long)__entry->mperf, 79 (unsigned long long)__entry->mperf,
84 (unsigned long long)__entry->aperf, 80 (unsigned long long)__entry->aperf,
85 (unsigned long)__entry->energy,
86 (unsigned long)__entry->freq 81 (unsigned long)__entry->freq
87 ) 82 )
88 83