Commit 801099be authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'pm-4.12-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull power management fixes from Rafael Wysocki:
 "These fix RTC wakeup from suspend-to-idle broken recently, fix CPU
  idleness detection condition in the schedutil cpufreq governor, fix a
  cpufreq driver build failure, fix an error code path in the power
  capping framework, clean up the hibernate core and update the
  intel_pstate documentation.

  Specifics:

   - Fix RTC wakeup from suspend-to-idle broken by the recent rework of
     ACPI wakeup handling (Rafael Wysocki).

   - Update intel_pstate driver documentation to reflect the current
     code and explain how it works in more detail (Rafael Wysocki).

   - Fix an issue related to CPU idleness detection on systems with
     shared cpufreq policies in the schedutil governor (Juri Lelli).

   - Fix a possible build issue in the dbx500 cpufreq driver (Arnd
     Bergmann).

   - Fix a function in the power capping framework core to return an
     error code instead of 0 when there's an error (Dan Carpenter).

   - Clean up variable definition in the hibernation core (Pushkar
     Jambhlekar)"

* tag 'pm-4.12-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  cpufreq: dbx500: add a Kconfig symbol
  PM / hibernate: Declare variables as static
  PowerCap: Fix an error code in powercap_register_zone()
  RTC: rtc-cmos: Fix wakeup from suspend-to-idle
  PM / wakeup: Fix up wakeup_source_report_event()
  cpufreq: intel_pstate: Document the current behavior and user interface
  cpufreq: schedutil: use now as reference when aggregating shared policy requests
parents ad258fb9 bb47e964
.. |struct cpufreq_policy| replace:: :c:type:`struct cpufreq_policy <cpufreq_policy>` .. |struct cpufreq_policy| replace:: :c:type:`struct cpufreq_policy <cpufreq_policy>`
.. |intel_pstate| replace:: :doc:`intel_pstate <intel_pstate>`
======================= =======================
CPU Performance Scaling CPU Performance Scaling
...@@ -75,7 +76,7 @@ feedback registers, as that information is typically specific to the hardware ...@@ -75,7 +76,7 @@ feedback registers, as that information is typically specific to the hardware
interface it comes from and may not be easily represented in an abstract, interface it comes from and may not be easily represented in an abstract,
platform-independent way. For this reason, ``CPUFreq`` allows scaling drivers platform-independent way. For this reason, ``CPUFreq`` allows scaling drivers
to bypass the governor layer and implement their own performance scaling to bypass the governor layer and implement their own performance scaling
algorithms. That is done by the ``intel_pstate`` scaling driver. algorithms. That is done by the |intel_pstate| scaling driver.
``CPUFreq`` Policy Objects ``CPUFreq`` Policy Objects
...@@ -174,13 +175,13 @@ necessary to restart the scaling governor so that it can take the new online CPU ...@@ -174,13 +175,13 @@ necessary to restart the scaling governor so that it can take the new online CPU
into account. That is achieved by invoking the governor's ``->stop`` and into account. That is achieved by invoking the governor's ``->stop`` and
``->start()`` callbacks, in this order, for the entire policy. ``->start()`` callbacks, in this order, for the entire policy.
As mentioned before, the ``intel_pstate`` scaling driver bypasses the scaling As mentioned before, the |intel_pstate| scaling driver bypasses the scaling
governor layer of ``CPUFreq`` and provides its own P-state selection algorithms. governor layer of ``CPUFreq`` and provides its own P-state selection algorithms.
Consequently, if ``intel_pstate`` is used, scaling governors are not attached to Consequently, if |intel_pstate| is used, scaling governors are not attached to
new policy objects. Instead, the driver's ``->setpolicy()`` callback is invoked new policy objects. Instead, the driver's ``->setpolicy()`` callback is invoked
to register per-CPU utilization update callbacks for each policy. These to register per-CPU utilization update callbacks for each policy. These
callbacks are invoked by the CPU scheduler in the same way as for scaling callbacks are invoked by the CPU scheduler in the same way as for scaling
governors, but in the ``intel_pstate`` case they both determine the P-state to governors, but in the |intel_pstate| case they both determine the P-state to
use and change the hardware configuration accordingly in one go from scheduler use and change the hardware configuration accordingly in one go from scheduler
context. context.
...@@ -257,7 +258,7 @@ are the following: ...@@ -257,7 +258,7 @@ are the following:
``scaling_available_governors`` ``scaling_available_governors``
List of ``CPUFreq`` scaling governors present in the kernel that can List of ``CPUFreq`` scaling governors present in the kernel that can
be attached to this policy or (if the ``intel_pstate`` scaling driver is be attached to this policy or (if the |intel_pstate| scaling driver is
in use) list of scaling algorithms provided by the driver that can be in use) list of scaling algorithms provided by the driver that can be
applied to this policy. applied to this policy.
...@@ -274,7 +275,7 @@ are the following: ...@@ -274,7 +275,7 @@ are the following:
the CPU is actually running at (due to hardware design and other the CPU is actually running at (due to hardware design and other
limitations). limitations).
Some scaling drivers (e.g. ``intel_pstate``) attempt to provide Some scaling drivers (e.g. |intel_pstate|) attempt to provide
information more precisely reflecting the current CPU frequency through information more precisely reflecting the current CPU frequency through
this attribute, but that still may not be the exact current CPU this attribute, but that still may not be the exact current CPU
frequency as seen by the hardware at the moment. frequency as seen by the hardware at the moment.
...@@ -284,13 +285,13 @@ are the following: ...@@ -284,13 +285,13 @@ are the following:
``scaling_governor`` ``scaling_governor``
The scaling governor currently attached to this policy or (if the The scaling governor currently attached to this policy or (if the
``intel_pstate`` scaling driver is in use) the scaling algorithm |intel_pstate| scaling driver is in use) the scaling algorithm
provided by the driver that is currently applied to this policy. provided by the driver that is currently applied to this policy.
This attribute is read-write and writing to it will cause a new scaling This attribute is read-write and writing to it will cause a new scaling
governor to be attached to this policy or a new scaling algorithm governor to be attached to this policy or a new scaling algorithm
provided by the scaling driver to be applied to it (in the provided by the scaling driver to be applied to it (in the
``intel_pstate`` case), as indicated by the string written to this |intel_pstate| case), as indicated by the string written to this
attribute (which must be one of the names listed by the attribute (which must be one of the names listed by the
``scaling_available_governors`` attribute described above). ``scaling_available_governors`` attribute described above).
...@@ -619,7 +620,7 @@ This file is located under :file:`/sys/devices/system/cpu/cpufreq/` and controls ...@@ -619,7 +620,7 @@ This file is located under :file:`/sys/devices/system/cpu/cpufreq/` and controls
the "boost" setting for the whole system. It is not present if the underlying the "boost" setting for the whole system. It is not present if the underlying
scaling driver does not support the frequency boost mechanism (or supports it, scaling driver does not support the frequency boost mechanism (or supports it,
but provides a driver-specific interface for controlling it, like but provides a driver-specific interface for controlling it, like
``intel_pstate``). |intel_pstate|).
If the value in this file is 1, the frequency boost mechanism is enabled. This If the value in this file is 1, the frequency boost mechanism is enabled. This
means that either the hardware can be put into states in which it is able to means that either the hardware can be put into states in which it is able to
......
...@@ -6,6 +6,7 @@ Power Management ...@@ -6,6 +6,7 @@ Power Management
:maxdepth: 2 :maxdepth: 2
cpufreq cpufreq
intel_pstate
.. only:: subproject and html .. only:: subproject and html
......
This diff is collapsed.
This diff is collapsed.
...@@ -512,13 +512,12 @@ static bool wakeup_source_not_registered(struct wakeup_source *ws) ...@@ -512,13 +512,12 @@ static bool wakeup_source_not_registered(struct wakeup_source *ws)
/** /**
* wakup_source_activate - Mark given wakeup source as active. * wakup_source_activate - Mark given wakeup source as active.
* @ws: Wakeup source to handle. * @ws: Wakeup source to handle.
* @hard: If set, abort suspends in progress and wake up from suspend-to-idle.
* *
* Update the @ws' statistics and, if @ws has just been activated, notify the PM * Update the @ws' statistics and, if @ws has just been activated, notify the PM
* core of the event by incrementing the counter of of wakeup events being * core of the event by incrementing the counter of of wakeup events being
* processed. * processed.
*/ */
static void wakeup_source_activate(struct wakeup_source *ws, bool hard) static void wakeup_source_activate(struct wakeup_source *ws)
{ {
unsigned int cec; unsigned int cec;
...@@ -526,9 +525,6 @@ static void wakeup_source_activate(struct wakeup_source *ws, bool hard) ...@@ -526,9 +525,6 @@ static void wakeup_source_activate(struct wakeup_source *ws, bool hard)
"unregistered wakeup source\n")) "unregistered wakeup source\n"))
return; return;
if (hard)
pm_system_wakeup();
ws->active = true; ws->active = true;
ws->active_count++; ws->active_count++;
ws->last_time = ktime_get(); ws->last_time = ktime_get();
...@@ -554,7 +550,10 @@ static void wakeup_source_report_event(struct wakeup_source *ws, bool hard) ...@@ -554,7 +550,10 @@ static void wakeup_source_report_event(struct wakeup_source *ws, bool hard)
ws->wakeup_count++; ws->wakeup_count++;
if (!ws->active) if (!ws->active)
wakeup_source_activate(ws, hard); wakeup_source_activate(ws);
if (hard)
pm_system_wakeup();
} }
/** /**
......
...@@ -71,6 +71,15 @@ config ARM_HIGHBANK_CPUFREQ ...@@ -71,6 +71,15 @@ config ARM_HIGHBANK_CPUFREQ
If in doubt, say N. If in doubt, say N.
config ARM_DB8500_CPUFREQ
tristate "ST-Ericsson DB8500 cpufreq" if COMPILE_TEST && !ARCH_U8500
default ARCH_U8500
depends on HAS_IOMEM
depends on !CPU_THERMAL || THERMAL
help
This adds the CPUFreq driver for ST-Ericsson Ux500 (DB8500) SoC
series.
config ARM_IMX6Q_CPUFREQ config ARM_IMX6Q_CPUFREQ
tristate "Freescale i.MX6 cpufreq support" tristate "Freescale i.MX6 cpufreq support"
depends on ARCH_MXC depends on ARCH_MXC
......
...@@ -53,7 +53,7 @@ obj-$(CONFIG_ARM_DT_BL_CPUFREQ) += arm_big_little_dt.o ...@@ -53,7 +53,7 @@ obj-$(CONFIG_ARM_DT_BL_CPUFREQ) += arm_big_little_dt.o
obj-$(CONFIG_ARM_BRCMSTB_AVS_CPUFREQ) += brcmstb-avs-cpufreq.o obj-$(CONFIG_ARM_BRCMSTB_AVS_CPUFREQ) += brcmstb-avs-cpufreq.o
obj-$(CONFIG_ARCH_DAVINCI) += davinci-cpufreq.o obj-$(CONFIG_ARCH_DAVINCI) += davinci-cpufreq.o
obj-$(CONFIG_UX500_SOC_DB8500) += dbx500-cpufreq.o obj-$(CONFIG_ARM_DB8500_CPUFREQ) += dbx500-cpufreq.o
obj-$(CONFIG_ARM_EXYNOS5440_CPUFREQ) += exynos5440-cpufreq.o obj-$(CONFIG_ARM_EXYNOS5440_CPUFREQ) += exynos5440-cpufreq.o
obj-$(CONFIG_ARM_HIGHBANK_CPUFREQ) += highbank-cpufreq.o obj-$(CONFIG_ARM_HIGHBANK_CPUFREQ) += highbank-cpufreq.o
obj-$(CONFIG_ARM_IMX6Q_CPUFREQ) += imx6q-cpufreq.o obj-$(CONFIG_ARM_IMX6Q_CPUFREQ) += imx6q-cpufreq.o
......
...@@ -538,6 +538,7 @@ struct powercap_zone *powercap_register_zone( ...@@ -538,6 +538,7 @@ struct powercap_zone *powercap_register_zone(
power_zone->id = result; power_zone->id = result;
idr_init(&power_zone->idr); idr_init(&power_zone->idr);
result = -ENOMEM;
power_zone->name = kstrdup(name, GFP_KERNEL); power_zone->name = kstrdup(name, GFP_KERNEL);
if (!power_zone->name) if (!power_zone->name)
goto err_name_alloc; goto err_name_alloc;
......
...@@ -1088,7 +1088,7 @@ static u32 rtc_handler(void *context) ...@@ -1088,7 +1088,7 @@ static u32 rtc_handler(void *context)
} }
spin_unlock_irqrestore(&rtc_lock, flags); spin_unlock_irqrestore(&rtc_lock, flags);
pm_wakeup_event(dev, 0); pm_wakeup_hard_event(dev);
acpi_clear_event(ACPI_EVENT_RTC); acpi_clear_event(ACPI_EVENT_RTC);
acpi_disable_event(ACPI_EVENT_RTC, 0); acpi_disable_event(ACPI_EVENT_RTC, 0);
return ACPI_INTERRUPT_HANDLED; return ACPI_INTERRUPT_HANDLED;
......
...@@ -1425,7 +1425,7 @@ static unsigned int nr_meta_pages; ...@@ -1425,7 +1425,7 @@ static unsigned int nr_meta_pages;
* Numbers of normal and highmem page frames allocated for hibernation image * Numbers of normal and highmem page frames allocated for hibernation image
* before suspending devices. * before suspending devices.
*/ */
unsigned int alloc_normal, alloc_highmem; static unsigned int alloc_normal, alloc_highmem;
/* /*
* Memory bitmap used for marking saveable pages (during hibernation) or * Memory bitmap used for marking saveable pages (during hibernation) or
* hibernation image pages (during restore) * hibernation image pages (during restore)
......
...@@ -245,11 +245,10 @@ static void sugov_update_single(struct update_util_data *hook, u64 time, ...@@ -245,11 +245,10 @@ static void sugov_update_single(struct update_util_data *hook, u64 time,
sugov_update_commit(sg_policy, time, next_f); sugov_update_commit(sg_policy, time, next_f);
} }
static unsigned int sugov_next_freq_shared(struct sugov_cpu *sg_cpu) static unsigned int sugov_next_freq_shared(struct sugov_cpu *sg_cpu, u64 time)
{ {
struct sugov_policy *sg_policy = sg_cpu->sg_policy; struct sugov_policy *sg_policy = sg_cpu->sg_policy;
struct cpufreq_policy *policy = sg_policy->policy; struct cpufreq_policy *policy = sg_policy->policy;
u64 last_freq_update_time = sg_policy->last_freq_update_time;
unsigned long util = 0, max = 1; unsigned long util = 0, max = 1;
unsigned int j; unsigned int j;
...@@ -265,7 +264,7 @@ static unsigned int sugov_next_freq_shared(struct sugov_cpu *sg_cpu) ...@@ -265,7 +264,7 @@ static unsigned int sugov_next_freq_shared(struct sugov_cpu *sg_cpu)
* enough, don't take the CPU into account as it probably is * enough, don't take the CPU into account as it probably is
* idle now (and clear iowait_boost for it). * idle now (and clear iowait_boost for it).
*/ */
delta_ns = last_freq_update_time - j_sg_cpu->last_update; delta_ns = time - j_sg_cpu->last_update;
if (delta_ns > TICK_NSEC) { if (delta_ns > TICK_NSEC) {
j_sg_cpu->iowait_boost = 0; j_sg_cpu->iowait_boost = 0;
continue; continue;
...@@ -309,7 +308,7 @@ static void sugov_update_shared(struct update_util_data *hook, u64 time, ...@@ -309,7 +308,7 @@ static void sugov_update_shared(struct update_util_data *hook, u64 time,
if (flags & SCHED_CPUFREQ_RT_DL) if (flags & SCHED_CPUFREQ_RT_DL)
next_f = sg_policy->policy->cpuinfo.max_freq; next_f = sg_policy->policy->cpuinfo.max_freq;
else else
next_f = sugov_next_freq_shared(sg_cpu); next_f = sugov_next_freq_shared(sg_cpu, time);
sugov_update_commit(sg_policy, time, next_f); sugov_update_commit(sg_policy, time, next_f);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment