Russell King | 3 Oct 10:24 2015

[RFC PATCH] cpuidle: mvebu: indicate failure to enter deeper sleep states

The cpuidle ->enter method expects the return value to be the sleep
state we entered.  Returning negative numbers or other codes is not
permissible since coupled CPU idle was merged.

At least some of the mvebu_v7_cpu_suspend() implementations return the
value from cpu_suspend(), which returns zero if the CPU vectors back
into the kernel via cpu_resume() (the success case), or the non-zero
return value of the suspend actor, or one (failure cases).

We do not want to be returning the failure case value back to CPU idle
as that indicates that we successfully entered one of the deeper idle
states.  Always return zero instead, indicating that we slept for the
shortest amount of time.

Signed-off-by: Russell King <rmk+kernel <at>>
Please think about this - having only an Armada 388 platform, I can't
test this due to CPU idle being disabled there.  However, the code paths
indicate that if we fail to sleep in armada_370_xp_pmsu_idle_enter() or
armada_38x_do_cpu_suspend() fail to sleep, we end up reporting that we
successfully slept in CPU idle state 1 in both cases.

Rafael - the code in cpuidle.c prior to the addition of coupled CPU idle
seems to allow the return of negative error numbers from the ->enter()

        if (entered_state >= 0) {
                /* Update cpuidle counters */
                /* This can be moved to within driver enter routine
                 * but that results in multiple copies of same code.
(Continue reading)

Russell King | 3 Oct 01:24 2015

[PATCH 2/2] cpuidle: mvebu: disable the bind/unbind attributes and use builtin_platform_driver

As the driver doesn't support unbinding, nor does it support arbitary
binding of devices, disable the bind/unbind attributes for this driver.
Also, as the driver has no remove function, it can never be modular,
so use builtin_platform_driver() to avoid the module exit boilerplate.

Signed-off-by: Russell King <rmk+kernel <at>>
 drivers/cpuidle/cpuidle-mvebu-v7.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/cpuidle/cpuidle-mvebu-v7.c b/drivers/cpuidle/cpuidle-mvebu-v7.c
index facd7d3e57dc..01a856971f05 100644
--- a/drivers/cpuidle/cpuidle-mvebu-v7.c
+++ b/drivers/cpuidle/cpuidle-mvebu-v7.c
 <at>  <at>  -127,11 +127,12  <at>  <at>  static struct platform_driver mvebu_cpuidle_driver = {
 	.probe = mvebu_v7_cpuidle_probe,
 	.driver = {
 		.name = "cpuidle-mbevu",
+		.suppress_bind_attrs = true,
 	.id_table = mvebu_cpuidle_ids,


 MODULE_AUTHOR("Gregory CLEMENT <gregory.clement <at>>");
 MODULE_DESCRIPTION("Marvell EBU v7 cpuidle driver");

(Continue reading)

Russell King | 3 Oct 01:24 2015

[PATCH 1/2] cpuidle: mvebu: clean up multiple platform drivers

There's no need to use multiple platform drivers, especially when we
want to do something different in the probe, but we still use a common
probe function.

We can use the platform ID system to only register one platform driver,
but have it match several devices, and give us the CPU idle driver via
the ID's driver_data.

Signed-off-by: Russell King <rmk+kernel <at>>
 drivers/cpuidle/cpuidle-mvebu-v7.c | 45 +++++++++++++++++---------------------
 1 file changed, 20 insertions(+), 25 deletions(-)

diff --git a/drivers/cpuidle/cpuidle-mvebu-v7.c b/drivers/cpuidle/cpuidle-mvebu-v7.c
index 980151f34707..facd7d3e57dc 100644
--- a/drivers/cpuidle/cpuidle-mvebu-v7.c
+++ b/drivers/cpuidle/cpuidle-mvebu-v7.c
 <at>  <at>  -99,44 +99,39  <at>  <at>  static struct cpuidle_driver armada38x_idle_driver = {

 static int mvebu_v7_cpuidle_probe(struct platform_device *pdev)
-	mvebu_v7_cpu_suspend = pdev->dev.platform_data;
+	const struct platform_device_id *id = pdev->id_entry;

-	if (!strcmp(pdev->dev.driver->name, "cpuidle-armada-xp"))
-		return cpuidle_register(&armadaxp_idle_driver, NULL);
-	else if (!strcmp(pdev->dev.driver->name, "cpuidle-armada-370"))
-		return cpuidle_register(&armada370_idle_driver, NULL);
-	else if (!strcmp(pdev->dev.driver->name, "cpuidle-armada-38x"))
-		return cpuidle_register(&armada38x_idle_driver, NULL);
(Continue reading)

Luis de Bethencourt | 2 Oct 16:27 2015

[PATCH v2] PM / AVS: rockchip-io: Fix module autoload for OF platform driver

This platform driver has a OF device ID table but the OF module
alias information is not created so module autoloading won't work.

Signed-off-by: Luis de Bethencourt <luisbg <at>>
Reviewed-by: Heiko Stuebner <heiko <at>>


Sending a second version to add Rafael Wysocki in the to-list as
suggested by Heiko Stübner.

This patch adds the missing MODULE_DEVICE_TABLE() for OF to export
that information so modules have the correct aliases built-in and
autoloading works correctly.

A longer explanation by Javier Canillas can be found here:


 drivers/power/avs/rockchip-io-domain.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/power/avs/rockchip-io-domain.c b/drivers/power/avs/rockchip-io-domain.c
index 2e30002..8099456 100644
--- a/drivers/power/avs/rockchip-io-domain.c
+++ b/drivers/power/avs/rockchip-io-domain.c
(Continue reading)

Olaf Hering | 2 Oct 11:50 2015

[PATCH] tools/thermal: tmon: use pkg-config also for CFLAGS

The header <panel.h> might be in /usr/include/ncursesw, which is not
part of the standard include path. This fixes compile on openSUSE.

Signed-off-by: Olaf Hering <olaf <at>>
 tools/thermal/tmon/Makefile | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tools/thermal/tmon/Makefile b/tools/thermal/tmon/Makefile
index 2e83dd3..3a961e9 100644
--- a/tools/thermal/tmon/Makefile
+++ b/tools/thermal/tmon/Makefile
 <at>  <at>  -22,6 +22,9  <at>  <at>  TMON_LIBS += $(shell pkg-config --libs $(STATIC) panelw ncursesw 2> /dev/null ||
 		     pkg-config --libs $(STATIC) panel ncurses 2> /dev/null || \
 		     echo -lpanel -lncurses)

+CFLAGS    += $(shell pkg-config --cflags $(STATIC) panelw ncursesw 2> /dev/null || \
+		     pkg-config --cflags $(STATIC) panel ncurses 2> /dev/null)
 OBJS = tmon.o tui.o sysfs.o pid.o
 OBJS +=

To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo <at>
More majordomo info at

MyungJoo Ham | 2 Oct 04:18 2015

[GIT PULL: Linux-PM] devfreq fixes for 4.3-rc4

Dear Rafael,

Here goes a pull-request for two bugfixes of devfreq.


Hash: SHA1

The following changes since commit 9ffecb10283508260936b96022d4ee43a7798b4c:

  Linux 4.3-rc3 (2015-09-27 07:50:08 -0400)

are available in the git repository at: tags/pull_req_4.3_rc4

for you to fetch changes up to 6d3cbfa718eeedd70efb9eb04ce9b261b6fa5b7b:

  PM / devfreq: fix double kfree (2015-10-02 11:05:58 +0900)

- ----------------------------------------------------------------
Pull request for Rafael from devfreq targetting next RC (4.3-rcX)

There are two bugfixes included.

- ----------------------------------------------------------------
Geliang Tang (1):
(Continue reading)

Rafael J. Wysocki | 2 Oct 03:11 2015

[GIT PULL] Power management and ACPI updates for v4.3-rc4

Hi Linus,

Please pull from

 git:// \

to receive power management and ACPI material for v4.3-rc4 with
top-most commit eb6d1c287ae1f7221248d5be26a5b1560073c09e

 Merge branches 'pm-cpuidle', 'pm-opp' and 'pm-tools'

on top of commit 9ffecb10283508260936b96022d4ee43a7798b4c

 Linux 4.3-rc3

These are fixes mostly, for a few changes made in this cycle
(the intel_idle driver, the OPP library, the ACPI EC driver,
turbostat) and for some issues that have just been discovered
(ACPI PCI IRQ management, PCI power management
documentation, turbostat), with a couple of cleanups on top
of them.


 - intel_idle driver fixup for the recently added Skylake chips
   support (Len Brown).

 - Operating Performance Points (OPP) library fix related to the
   recently added support for new DT bindings and a fix for a typo
(Continue reading)

Srinivas Pandruvada | 2 Oct 00:25 2015

[PATCH] cpufreq: acpi_cpufreq: base frequency attribute support

Currently scaling_available_frequencies displays list of available
frequencies which can be used to set max/min or current scaling frequency.

>cat scaling_available_frequencies
2301000 2300000 2200000 2000000 1900000 1800000 1700000 1500000 1400000
1300000 1100000 1000000 900000 800000 600000 500000

Here traditionally it is assumed that only 2301000 is a turbo frequency,
which is purely opportunistic, anything else user can request and may
get it.
But because of configurable thermal design power implementation in several
Intel CPUs, the opportunistic frequency start can be any frequency in this
range. For example it can be 2300000 or any lower value.
This change adds an optional new attribute called "base_frequency",
which displays the max non-turbo frequency (base frequency). For example:
>cat base_frequency
This will allow user to choose a certain frequency which is not

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada <at>>
 drivers/cpufreq/acpi-cpufreq.c | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c
index cec1ee2..4433f6b 100644
--- a/drivers/cpufreq/acpi-cpufreq.c
+++ b/drivers/cpufreq/acpi-cpufreq.c
 <at>  <at>  -70,6 +70,7  <at>  <at>  struct acpi_cpufreq_data {
(Continue reading)

Srinivas Pandruvada | 2 Oct 00:23 2015

[PATCH 1/2] cpufreq: acpi_cpufreq: prevent crash on reading freqdomain_cpus

When freqdomain_cpus attribute is read from an offlined cpu, it will
cause crash. This change prevents calling cpufreq_show_cpus when
mask is NULL. Alternatively we can add this NULL check in
cpufreq_show_cpus function.

Crash info:

[  170.814949] BUG: unable to handle kernel NULL pointer dereference at 0000000000000018
[  170.814990] IP: [<ffffffff813b2490>] _find_next_bit.part.0+0x10/0x70
[  170.815021] PGD 227d30067 PUD 229e56067 PMD 0
[  170.815043] Oops: 0000 [#2] SMP
[  170.816022] CPU: 3 PID: 3121 Comm: cat Tainted: G      D    OE   4.3.0-rc3+ #33
[  170.816657] Call Trace:
[  170.816672]  [<ffffffff813b2505>] ? find_next_bit+0x15/0x20
[  170.816696]  [<ffffffff8160e47c>] cpufreq_show_cpus+0x5c/0xd0
[  170.816722]  [<ffffffffa031a409>] show_freqdomain_cpus+0x19/0x20 [acpi_cpufreq]
[  170.816749]  [<ffffffff8160e65b>] show+0x3b/0x60
[  170.816769]  [<ffffffff8129b31c>] sysfs_kf_seq_show+0xbc/0x130
[  170.816793]  [<ffffffff81299be3>] kernfs_seq_show+0x23/0x30
[  170.816816]  [<ffffffff81240f2c>] seq_read+0xec/0x390
[  170.816837]  [<ffffffff8129a64a>] kernfs_fop_read+0x10a/0x160
[  170.816861]  [<ffffffff8121d9b7>] __vfs_read+0x37/0x100
[  170.816883]  [<ffffffff813217c0>] ? security_file_permission+0xa0/0xc0
[  170.816909]  [<ffffffff8121e2e3>] vfs_read+0x83/0x130
[  170.816930]  [<ffffffff8121f035>] SyS_read+0x55/0xc0
[  170.817185] ---[ end trace bc6eadf82b2b965a ]---
(Continue reading)

Rasmus Villemoes | 1 Oct 23:45 2015


The macros KELVIN_TO_CELSIUS and CELSIUS_TO_KELVIN actually convert
between deciKelvins and Celsius, so rename them to reflect that. While
at it, use a statement expression in DECI_KELVIN_TO_CELSIUS to prevent
expanding the argument multiple times and get rid of a few casts.

Signed-off-by: Rasmus Villemoes <linux <at>>
Cleaning out old branches, I stumbled on this which apparently fell
through the cracks
[]. The
unit mismatch still bugs the physicist in me, so I'm resending.

 drivers/acpi/thermal.c              | 12 ++++++------
 drivers/platform/x86/asus-wmi.c     |  2 +-
 drivers/platform/x86/intel_menlow.c |  8 ++++----
 include/linux/thermal.h             |  8 +++++---
 4 files changed, 16 insertions(+), 14 deletions(-)

diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
index 30d8518b25fb..82707f9824ca 100644
--- a/drivers/acpi/thermal.c
+++ b/drivers/acpi/thermal.c
 <at>  <at>  -315,7 +315,7  <at>  <at>  static int acpi_thermal_trips_update(struct acpi_thermal *tz, int flag)
 			if (crt == -1) {
 				tz->trips.critical.flags.valid = 0;
 			} else if (crt > 0) {
-				unsigned long crt_k = CELSIUS_TO_KELVIN(crt);
+				unsigned long crt_k = CELSIUS_TO_DECI_KELVIN(crt);
 				 * Allow override critical threshold
(Continue reading)

Julia Lawall | 1 Oct 23:19 2015

[PATCH] thermal: exynos: fix semicolon.cocci warnings

Remove unneeded semicolons.

Generated by: scripts/coccinelle/misc/semicolon.cocci

Signed-off-by: Julia Lawall <julia.lawall <at>>
Signed-off-by: Fengguang Wu <fengguang.wu <at>>

 exynos_tmu.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/thermal/samsung/exynos_tmu.c
+++ b/drivers/thermal/samsung/exynos_tmu.c
 <at>  <at>  -548,7 +548,7  <at>  <at>  static int exynos5433_tmu_initialize(str
 		pdata->cal_type = TYPE_ONE_POINT_TRIMMING;
-	};
+	}

 	dev_info(&pdev->dev, "Calibration type is %d-point calibration\n",
 			cal_type ?  2 : 1);
 <at>  <at>  -1363,7 +1363,7  <at>  <at>  static int exynos_tmu_probe(struct platf
-	};
+	}

 	ret = exynos_tmu_initialize(pdev);
(Continue reading)