Zhaoyang Huang | 27 Jun 09:42 2016

[RFC PATCH v3 1/2] power/cpuidle: enhance the precision of state select

In previous version, cpu_pm_enter is invoked after the governor
select the state, which cause the executing time of cpu_pm_enter
is included in the idle time. Moving it before the state selection.

Please refer to bellowing chart for detailed information

current approach:
static void cpu_idle_loop(void)
{
	while (1) {
		tick_nohz_idle_enter();
		--->__tick_nohz_idle_enter
		--->tick_nohz_stop_sched_tick
		    {
		    ...
		    	ts->sleep_length = ktime_sub(dev->next_event, now);          /*1*/
		    ...
		    }

		while (!need_resched()) {
			...
			local_irq_disable();
			arch_cpu_idle_enter();
			--->idle_notifier_call_chain(IDLE_START);                    /*2*/

			cpuidle_idle_call();
			--->next_state = cpuidle_select(drv, dev);                   /*3*/
			--->static int arm_enter_idle_state(...)
			{
			...
(Continue reading)

Jan Beulich | 27 Jun 08:35 2016

[PATCH v2 2/2] intel_idle: correct BXT support

Commit 5dcef69486 ("intel_idle: add BXT support") added an 8-element
lookup array with just a 2-bit value used for lookups. As per the SDM
that bit field is really 3 bits wide. While this is supposedly benign
here, future re-use of the code for other CPUs might expose the issue.

Signed-off-by: Jan Beulich <jbeulich <at> suse.com>
---
 drivers/idle/intel_idle.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- 4.7-rc5-intel-idle-BXT.orig/drivers/idle/intel_idle.c
+++ 4.7-rc5-intel-idle-BXT/drivers/idle/intel_idle.c
 <at>  <at>  -1157,7 +1157,7  <at>  <at>  static unsigned long long irtl_2_usec(un
 	if (!irtl)
 		return 0;

-	ns = irtl_ns_units[(irtl >> 10) & 0x3];
+	ns = irtl_ns_units[(irtl >> 10) & 0x7];

 	return div64_u64((irtl & 0x3FF) * ns, 1000);
 }

--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Jan Beulich | 27 Jun 08:35 2016

[PATCH v2 1/2] intel_idle: re-work bxt_idle_state_table_update() and its helper

Since irtl_ns_units[] has itself zero entries, make sure the caller
recognized those cases along with the MSR read returning zero, as zero
is not a valid value for exit_latency and target_residency.

Signed-off-by: Jan Beulich <jbeulich <at> suse.com>
---
 drivers/idle/intel_idle.c |   29 ++++++++++++++---------------
 1 file changed, 14 insertions(+), 15 deletions(-)

--- 4.7-rc5-intel-idle-BXT.orig/drivers/idle/intel_idle.c
+++ 4.7-rc5-intel-idle-BXT/drivers/idle/intel_idle.c
 <at>  <at>  -1154,6 +1154,9  <at>  <at>  static unsigned long long irtl_2_usec(un
 {
 	unsigned long long ns;

+	if (!irtl)
+		return 0;
+
 	ns = irtl_ns_units[(irtl >> 10) & 0x3];

 	return div64_u64((irtl & 0x3FF) * ns, 1000);
 <at>  <at>  -1167,43 +1170,39  <at>  <at>  static unsigned long long irtl_2_usec(un
 static void bxt_idle_state_table_update(void)
 {
 	unsigned long long msr;
+	unsigned int usec;

 	rdmsrl(MSR_PKGC6_IRTL, msr);
-	if (msr) {
-		unsigned int usec = irtl_2_usec(msr);
(Continue reading)

Chen Yu | 25 Jun 18:18 2016
Picon

[PATCH 0/4][RFC v2] x86, hotplug: Use hlt instead of mwait when resuming from hibernation

Currently it is reported that, when system is trying to resume
from hibernation, the nonboot CPUs might be incorrectly woken up
and hang there. The reason for this is because of inconsistent
page tables across hibernation resume. To avoid this situation,
use hlt instead of mwait to put nonboot CPUs in a more safe state
and just let them watch the boot CPU to do all the things and
wakes them up later.

The first three patches are preparation for the fourth one, please
refer to [4/4] for detail.

Chen Yu (4):
  PM / sleep: Avoid accessing frozen_cpus if it is NULL
  PM / sleep: Introduce arch-specific hook for disable/enable nonboot
    cpus
  PM / hibernate: introduce a flag to indicate resuming from hibernation
  x86, hotplug: Use hlt instead of mwait when resuming from hibernation

 arch/x86/kernel/smpboot.c | 15 +++++++++++++++
 include/linux/cpu.h       |  2 ++
 include/linux/suspend.h   |  7 +++++++
 kernel/cpu.c              | 38 ++++++++++++++++++++++++++++++++++++++
 kernel/power/hibernate.c  |  3 +++
 5 files changed, 65 insertions(+)

--

-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
(Continue reading)

Rafael J. Wysocki | 25 Jun 00:49 2016

[GIT PULL] Power management fixes for v4.7-rc5

Hi Linus,

Please pull from

 git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git \
 pm-4.7-rc5

to receive power management fixes for v4.7-rc5 with top-most commit
e753f3050935ff5a52069fef802bee72ab19c098

 Merge branches 'pm-devfreq-fixes' and 'pm-cpufreq-fixes'

on top of commit 33688abb2802ff3a230bd2441f765477b94cc89e

 Linux 4.7-rc4

Fix for a latent cpufreq driver bug uncovered by a recent ACPICA
change and several fixes for the devfreq framework, including one
fix for an issue introduced recently.

Specifics:

 - Fix a latent initialization issue in the pcc-cpufreq driver
   (incorrect initial value of a structure field) that has been
   uncovered by a recent ACPICA commit (Mike Galbraith).

 - Add a missing notification in an update_devfreq() error code
   path forgotten by a recent devfreq commit (Chanwoo Choi).

 - Fix devfreq device frequency initialization (Lukasz Luba).
(Continue reading)

Akshay Adiga | 24 Jun 16:03 2016
Picon

[PATCH] cpufreq: powernv: Replacing pstate_id with frequency table index

Refactoring code to use frequency table index instead of pstate_id.
This abstraction will make the code independent of the pstate values.

- No functional changes
- The highest frequency is at frequency table index 0 and the frequency
  decreases as the index increases.
- Macros get_index() and get_pstate() can be used for conversion between
  pstate_id and index.
- powernv_pstate_info now contains frequency table index to min, max and
  nominal frequency (instead of pstate_ids)

Signed-off-by: Akshay Adiga <akshay.adiga <at> linux.vnet.ibm.com>
---
 drivers/cpufreq/powernv-cpufreq.c | 107 ++++++++++++++++++++++----------------
 1 file changed, 61 insertions(+), 46 deletions(-)

diff --git a/drivers/cpufreq/powernv-cpufreq.c b/drivers/cpufreq/powernv-cpufreq.c
index b29c5c2..f6ce6f0 100644
--- a/drivers/cpufreq/powernv-cpufreq.c
+++ b/drivers/cpufreq/powernv-cpufreq.c
 <at>  <at>  -43,6 +43,7  <at>  <at> 
 #define PMSR_SPR_EM_DISABLE	(1UL << 31)
 #define PMSR_MAX(x)		((x >> 32) & 0xFF)

+
 #define MAX_RAMP_DOWN_TIME				5120
 /*
  * On an idle system we want the global pstate to ramp-down from max value to
 <at>  <at>  -124,20 +125,29  <at>  <at>  static int nr_chips;
 static DEFINE_PER_CPU(struct chip *, chip_info);
(Continue reading)

Shreyas B. Prabhu | 24 Jun 10:23 2016
Picon

[PATCH v2] cpuidle: Fix last_residency division

Snooze is a poll idle state in powernv and pseries platforms. Snooze
has a timeout so that if a cpu stays in snooze for more than target
residency of the next available idle state, then it would exit thereby
giving chance to the cpuidle governor to re-evaluate and
promote the cpu to a deeper idle state. Therefore whenever snooze exits
due to this timeout, its last_residency will be target_residency of next
deeper state.

commit e93e59ce5b85 ("cpuidle: Replace ktime_get() with local_clock()")
changed the math around last_residency calculation. Specifically, while
converting last_residency value from nanoseconds to microseconds it does
right shift by 10. Due to this, in snooze timeout exit scenarios
last_residency calculated is roughly 2.3% less than target_residency of
next available state. This pattern is picked up get_typical_interval()
in the menu governor and therefore expected_interval in menu_select() is
frequently less than the target_residency of any state but snooze.

Due to this we are entering snooze at a higher rate, thereby affecting
the single thread performance.

Fix this by replacing right shift by 10 with /1000 while calculating
last_residency.

Reported-by: Anton Blanchard <anton <at> samba.org>
Bisected-by: Shilpasri G Bhat <shilpa.bhat <at> linux.vnet.ibm.com>
Signed-off-by: Shreyas B. Prabhu <shreyas <at> linux.vnet.ibm.com>
---
Changes in v2
=============
 - Fixing it in the cpuidle core code instead of driver code.
(Continue reading)

Wenyou Yang | 24 Jun 09:17 2016

[PATCH 0/7] power: act8945a_charger: Improvements

This patch series is used to improve the act8945a-charger, such as
improve the way to check the status, fix the power supply type
property, add the status change update, and add more properties:
capacity level property and max current property.

Wenyou Yang (7):
  power: act8945a_charger: Remove "battery_temperature"
  power: act8945a_charger: Improve
  power: act8945a_charger: Add status change update support
  power: act8945a_charger: Fix the power supply type
  power: act8945a_charger: Add capacity level property
  power: act8945a_charger: Add max current property
  doc: bindings: act8945a-charger: Update properties

 .../devicetree/bindings/power/act8945a-charger.txt |   6 +-
 drivers/power/act8945a_charger.c                   | 371 ++++++++++++++++++---
 2 files changed, 337 insertions(+), 40 deletions(-)

--

-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Xiaolong Wang | 24 Jun 05:28 2016
Picon

[PATCH] powercap/intel_rapl: Add support for Ivy Bridge server

It's confirmed that RAPL works as expected on Ivy Bridge servers.
Tested against processor: Intel(R) Xeon(R) CPU E5-2697 v2  <at> 2.70GHz

Signed-off-by: Xiaolong Wang <xiaolong.wang <at> linux.intel.com>
---
 drivers/powercap/intel_rapl.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/powercap/intel_rapl.c b/drivers/powercap/intel_rapl.c
index 06d21e6..fbab29d 100644
--- a/drivers/powercap/intel_rapl.c
+++ b/drivers/powercap/intel_rapl.c
 <at>  <at>  -1134,6 +1134,7  <at>  <at>  static const struct x86_cpu_id rapl_ids[] __initconst = {
 	RAPL_CPU(INTEL_FAM6_SANDYBRIDGE_X,	rapl_defaults_core),

 	RAPL_CPU(INTEL_FAM6_IVYBRIDGE,		rapl_defaults_core),
+	RAPL_CPU(INTEL_FAM6_IVYBRIDGE_X,	rapl_defaults_core),

 	RAPL_CPU(INTEL_FAM6_HASWELL_CORE,	rapl_defaults_core),
 	RAPL_CPU(INTEL_FAM6_HASWELL_ULT,	rapl_defaults_core),
--

-- 
1.8.3.1

--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

MyungJoo Ham | 24 Jun 02:28 2016

RE: Re: [PATCH] PM / devfreq: Send the DEVFREQ_POSTCHANGE notification when target() is failed

> Hi,
> 
> 2016-06-23 22:40 GMT+09:00 Rafael J. Wysocki <rafael <at> kernel.org>:
> > On Thu, Jun 23, 2016 at 4:18 AM, Chanwoo Choi <cw00.choi <at> samsung.com> wrote:
> >> This patch sends the DEVFREQ_POSTCHANGE notification when
> >> devfreq->profile->targer() is failed. The PRECHANGE/POSTCHANGE
> >> should be paired.
> >>
> >> Fixes: 0fe3a66410a3 ("PM / devfreq: Add new DEVFREQ_TRANSITION_NOTIFIER notifier")
> >> Reported-by: Lin Huang <hl <at> rock-chips.com>
> >> Signed-off-by: Chanwoo Choi <cw00.choi <at> samsung.com>
> >> ---
> >
> > This looks like a fix for a recent regression, so I can apply it directly.
> >
> > Do you want me to do that?
> 
> Yes. Thanks for picking this patch up.
> 
> Regards,
> Chanwoo Choi
> 
> 

That'd be great. Thanks!


Cheers,
MyungJoo
(Continue reading)

Srinivas Pandruvada | 24 Jun 00:02 2016
Picon

[PATCH] thermal: intel_pch_thermal: Add suspend/resume callback

Added suspend/resume callback to disable/enable PCH thermal sensor
respectively. If the sensor is enabled by the BIOS, then the sensor status
will not be changed during suspend/resume.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada <at> linux.intel.com>
---
 drivers/thermal/intel_pch_thermal.c | 60 ++++++++++++++++++++++++++++++++++++-
 1 file changed, 59 insertions(+), 1 deletion(-)

diff --git a/drivers/thermal/intel_pch_thermal.c b/drivers/thermal/intel_pch_thermal.c
index 6a6ec1c..9b4815e 100644
--- a/drivers/thermal/intel_pch_thermal.c
+++ b/drivers/thermal/intel_pch_thermal.c
 <at>  <at>  -21,6 +21,7  <at>  <at> 
 #include <linux/init.h>
 #include <linux/pci.h>
 #include <linux/thermal.h>
+#include <linux/pm.h>

 /* Intel PCH thermal Device IDs */
 #define PCH_THERMAL_DID_WPT	0x9CA4 /* Wildcat Point */
 <at>  <at>  -65,6 +66,7  <at>  <at>  struct pch_thermal_device {
 	unsigned long crt_temp;
 	int hot_trip_id;
 	unsigned long hot_temp;
+	bool bios_enabled;
 };

 static int pch_wpt_init(struct pch_thermal_device *ptd, int *nr_trips)
 <at>  <at>  -75,8 +77,10  <at>  <at>  static int pch_wpt_init(struct pch_thermal_device *ptd, int *nr_trips)
(Continue reading)


Gmane