History

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

Linus Torvalds committed 12 years ago

Commit eef445e2 parents 3bd354a 465e5fc6 files · +21 −22Browse files

Unified · Split

6 files
  1. MAINTAINERS +1 −1
  2. drivers/acpi/container.c +3 −2
  3. drivers/acpi/dock.c +3 −2
  4. drivers/cpufreq/intel_pstate.c +0 −9
  5. drivers/pci/hotplug/acpiphp_glue.c +13 −2
  6. include/trace/events/power.h +1 −6
MAINTAINERS+1−1
@@ -2367,7 +2367,7 @@ F: include/linux/cpufreq.h · 2366 unmodified lines
23672367
23682368 CPU FREQUENCY DRIVERS - ARM BIG LITTLE
23692369 M: Viresh Kumar <viresh.kumar@linaro.org>
2370−M: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
2370+M: Sudeep Holla <sudeep.holla@arm.com>
23712371 L: cpufreq@vger.kernel.org
23722372 L: linux-pm@vger.kernel.org
23732373 W: http://www.arm.com/products/processors/technologies/biglittleprocessing.php
drivers/acpi/container.c+3−2
@@ -79,9 +79,10 @@ static int container_device_attach(struct acpi_device *adev, · 78 unmodified lines
7979 ACPI_COMPANION_SET(dev, adev);
8080 dev->release = acpi_container_release;
8181 ret = device_register(dev);
82− if (ret)
82+ if (ret) {
83+ put_device(dev);
8384 return ret;
84−
85+ }
8586 adev->driver_data = dev;
8687 return 1;
8788 }
drivers/acpi/dock.c+3−2
@@ -609,7 +609,7 @@ static int handle_eject_request(struct dock_station *ds, u32 event) · 608 unmodified lines
609609 static void dock_notify(struct dock_station *ds, u32 event)
610610 {
611611 acpi_handle handle = ds->handle;
612− struct acpi_device *ad;
612+ struct acpi_device *adev = NULL;
613613 int surprise_removal = 0;
614614
615615 /*
@@ -632,7 +632,8 @@ static void dock_notify(struct dock_station *ds, u32 event) · 16 unmodified lines
632632 switch (event) {
633633 case ACPI_NOTIFY_BUS_CHECK:
634634 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)) {
636637 begin_dock(ds);
637638 dock(ds);
638639 if (!dock_present(ds)) {
drivers/cpufreq/intel_pstate.c+0−9
@@ -51,8 +51,6 @@ static inline int32_t div_fp(int32_t x, int32_t y) · 50 unmodified lines
5151 return div_s64((int64_t)x << FRAC_BITS, (int64_t)y);
5252 }
5353
54−static u64 energy_divisor;
55−
5654 struct sample {
5755 int32_t core_pct_busy;
5856 u64 aperf;
@@ -630,12 +628,10 @@ static void intel_pstate_timer_func(unsigned long __data) · 571 unmodified lines
630628 {
631629 struct cpudata *cpu = (struct cpudata *) __data;
632630 struct sample *sample;
633− u64 energy;
634631
635632 intel_pstate_sample(cpu);
636633
637634 sample = &cpu->samples[cpu->sample_ptr];
638− rdmsrl(MSR_PKG_ENERGY_STATUS, energy);
639635
640636 intel_pstate_adjust_busy_pstate(cpu);
641637
@@ -644,7 +640,6 @@ static void intel_pstate_timer_func(unsigned long __data) · 2 unmodified lines
644640 cpu->pstate.current_pstate,
645641 sample->mperf,
646642 sample->aperf,
647− div64_u64(energy, energy_divisor),
648643 sample->freq);
649644
650645 intel_pstate_set_sample_time(cpu);
@@ -926,7 +921,6 @@ static int __init intel_pstate_init(void) · 275 unmodified lines
926921 int cpu, rc = 0;
927922 const struct x86_cpu_id *id;
928923 struct cpu_defaults *cpu_info;
929− u64 units;
930924
931925 if (no_load)
932926 return -ENODEV;
@@ -960,9 +954,6 @@ static int __init intel_pstate_init(void) · 27 unmodified lines
960954 if (rc)
961955 goto out;
962956
963− rdmsrl(MSR_RAPL_POWER_UNIT, units);
964− energy_divisor = 1 << ((units >> 8) & 0x1f); /* bits{12:8} */
965−
966957 intel_pstate_debug_expose_params();
967958 intel_pstate_sysfs_expose_params();
968959
drivers/pci/hotplug/acpiphp_glue.c+13−2
@@ -730,6 +730,17 @@ static unsigned int get_slot_status(struct acpiphp_slot *slot) · 729 unmodified lines
730730 return (unsigned int)sta;
731731 }
732732
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+
733744 /**
734745 * trim_stale_devices - remove PCI devices that are not responding.
735746 * @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
745756 unsigned long long sta;
746757
747758 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))
749760 || acpiphp_no_hotplug(handle);
750761 }
751762 if (!alive) {
@@ -792,7 +803,7 @@ static void acpiphp_check_bridge(struct acpiphp_bridge *bridge) · 40 unmodified lines
792803 mutex_lock(&slot->crit_sect);
793804 if (slot_no_hotplug(slot)) {
794805 ; /* do nothing */
795− } else if (get_slot_status(slot) == ACPI_STA_ALL) {
806+ } else if (device_status_valid(get_slot_status(slot))) {
796807 /* remove stale devices if any */
797808 list_for_each_entry_safe_reverse(dev, tmp,
798809 &bus->devices, bus_list)
include/trace/events/power.h+1−6
@@ -42,7 +42,6 @@ TRACE_EVENT(pstate_sample, · 41 unmodified lines
4242 u32 state,
4343 u64 mperf,
4444 u64 aperf,
45− u32 energy,
4645 u32 freq
4746 ),
4847
@@ -51,7 +50,6 @@ TRACE_EVENT(pstate_sample, · 2 unmodified lines
5150 state,
5251 mperf,
5352 aperf,
54− energy,
5553 freq
5654 ),
5755
@@ -61,7 +59,6 @@ TRACE_EVENT(pstate_sample, · 3 unmodified lines
6159 __field(u32, state)
6260 __field(u64, mperf)
6361 __field(u64, aperf)
64− __field(u32, energy)
6562 __field(u32, freq)
6663
6764 ),
@@ -72,17 +69,15 @@ TRACE_EVENT(pstate_sample, · 4 unmodified lines
7269 __entry->state = state;
7370 __entry->mperf = mperf;
7471 __entry->aperf = aperf;
75− __entry->energy = energy;
7672 __entry->freq = freq;
7773 ),
7874
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 ",
8076 (unsigned long)__entry->core_busy,
8177 (unsigned long)__entry->scaled_busy,
8278 (unsigned long)__entry->state,
8379 (unsigned long long)__entry->mperf,
8480 (unsigned long long)__entry->aperf,
85− (unsigned long)__entry->energy,
8681 (unsigned long)__entry->freq
8782 )
8883

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t