Soren Brinkmann | 22 Sep 19:07 2014

[PATCH RESEND] PM / sleep: Fix racing timers

On platforms that do not power off during suspend, successfully entering
suspend races with timers.

The race happening in a couple of location is:

  1. disable IRQs   		(e.g. arch_suspend_disable_irqs())
     ...
  2. syscore_suspend()
      -> timekeeping_suspend()
       -> clockevents_notify(SUSPEND)
        -> tick_suspend()   	(timers are turned off here)
     ...
  3. wfi            		(wait for wake-IRQ here)

Between steps 1 and 2 the timers can still generate interrupts that are
not handled and stay pending until step 3. That pending IRQ causes an
immediate - spurious - wake.

The solution is to move the clockevents suspend/resume notification
out of the syscore_suspend step and explictly call them at the appropriate
time in the suspend/hibernation paths. I.e. timers are suspend _before_
IRQs get disabled. And accordingly in the resume path.

Signed-off-by: Soren Brinkmann <soren.brinkmann <at> xilinx.com>
---
Hi,

there was not a lot of discussion on the last submission. Just one comment from
Rafael (https://lkml.org/lkml/2014/8/26/780), which - as I outlined in my
response, does not apply, IMHO, since the platform does not re-enable
(Continue reading)

Pramod Gurav | 22 Sep 09:42 2014

[PATCH v2] power: reset: use restart_notifier mechanism for msm-poweroff

This change replaces use of arm_pm_restart with recently introduced
reset mechanism in Linux kernel called restart_notifier.

Cc: Guenter Roeck <linux <at> roeck-us.net>
Cc: Josh Cartwright <joshc <at> codeaurora.org>
Cc: Sebastian Reichel <sre <at> kernel.org>
Cc: Dmitry Eremin-Solenikov <dbaryshkov <at> gmail.com>
Cc: David Woodhouse <dwmw2 <at> infradead.org>
Cc: Stephen Boyd <sboyd <at> codeaurora.org>
Cc: linux-pm <at> vger.kernel.org

Signed-off-by: Pramod Gurav <pramod.gurav <at> smartplayin.com>
---
Tested on Dragonboard APQ8074

Changes since v1:
- Initialized restart_nb with its declaration
- Removed return check for register_restart_handler as it always
  returns 0 as per Guenter's suggestion to Josh's similar patch.
  This takes care of Guenter's comments on error logs and NULL
  initialization of restart_nb.notifier_call.

 drivers/power/reset/msm-poweroff.c |   17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/drivers/power/reset/msm-poweroff.c b/drivers/power/reset/msm-poweroff.c
index 774f9a3..db73238 100644
--- a/drivers/power/reset/msm-poweroff.c
+++ b/drivers/power/reset/msm-poweroff.c
 <at>  <at>  -24,17 +24,24  <at>  <at> 
(Continue reading)

Heiko Stuebner | 21 Sep 22:05 2014
Picon

[PATCH v2 0/3] gpio-charger: add devicetree support

This series adds devicetree support to the gpio-charger and fixes a small
issue with the return value of gpio_get_value.

changes since v1:
- adapt binding example to show how the charger fits into the
  power-supplies structure

Heiko Stuebner (3):
  dt-bindings: document gpio-charger bindings
  power: gpio-charger: add device tree support
  power: gpio-charger: do not use gpio value directly

 .../bindings/power_supply/gpio-charger.txt         | 27 +++++++++
 drivers/power/gpio-charger.c                       | 68 ++++++++++++++++++++--
 2 files changed, 91 insertions(+), 4 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/power_supply/gpio-charger.txt

--

-- 
1.9.0

--
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

Todd E Brandt | 19 Sep 23:07 2014
Picon

[PATCH] new suspend_resume trace event for console resume

This patch adds another suspend_resume trace event for analyze_suspend
to capture. The resume_console call can take several hundred milliseconds
if the printk buffer is full of debug info. The tool will now inform 
testers of the wasted time and encourage them to disable it in
production builds.

Signed-off-by: Todd Brandt <todd.e.brandt <at> intel.com>
----
 kernel/power/suspend.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c
index 18c6219..e837dd6 100644
--- a/kernel/power/suspend.c
+++ b/kernel/power/suspend.c
 <at>  <at>  -361,7 +361,9  <at>  <at>  int suspend_devices_and_enter(suspend_state_t state)
 	suspend_test_start();
 	dpm_resume_end(PMSG_RESUME);
 	suspend_test_finish("resume devices");
+	trace_suspend_resume(TPS("resume_console"), state, true);
 	resume_console();
+	trace_suspend_resume(TPS("resume_console"), state, false);

  Close:
 	platform_suspend_end(state);
--
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

(Continue reading)

Pramod Gurav | 19 Sep 20:05 2014

[PATCH] thermal: ti-soc-thermal: Switch to using managed resources

This change switches to managed resource APIs to allocated resources
such as irq, clock. Hence does away with release statements of the
same resorces in error lables and remove function.

Cc: Eduardo Valentin <eduardo.valentin <at> ti.com>
Cc: Zhang Rui <rui.zhang <at> intel.com>
Cc: linux-pm <at> vger.kernel.org
Signed-off-by: Pramod Gurav <pramod.gurav <at> smartplayin.com>
---
 drivers/thermal/ti-soc-thermal/ti-bandgap.c | 46 ++++++++---------------------
 1 file changed, 12 insertions(+), 34 deletions(-)

diff --git a/drivers/thermal/ti-soc-thermal/ti-bandgap.c b/drivers/thermal/ti-soc-thermal/ti-bandgap.c
index 634b6ce..e068dd5 100644
--- a/drivers/thermal/ti-soc-thermal/ti-bandgap.c
+++ b/drivers/thermal/ti-soc-thermal/ti-bandgap.c
 <at>  <at>  -1060,7 +1060,7  <at>  <at>  static int ti_bandgap_tshut_init(struct ti_bandgap *bgp,
 	int status;

 	/* Request for gpio_86 line */
-	status = gpio_request(gpio_nr, "tshut");
+	status = devm_gpio_request(&pdev->dev, gpio_nr, "tshut");
 	if (status < 0) {
 		dev_err(bgp->dev, "Could not request for TSHUT GPIO:%i\n", 86);
 		return status;
 <at>  <at>  -1071,11 +1071,12  <at>  <at>  static int ti_bandgap_tshut_init(struct ti_bandgap *bgp,
 		return status;
 	}

-	status = request_irq(gpio_to_irq(gpio_nr), ti_bandgap_tshut_irq_handler,
(Continue reading)

Lucas Stach | 19 Sep 18:16 2014
Picon

[PATCH 0/5] i.MX53 cpufreq support

This series implements cpufreq support for the i.MX53 SoC
using the generic cpufreq-cpu0 driver. The design is based
on feedback I got on the last round of patches.

Basically this implements a CPU clock type that abstracts away
all the clock handling required for reprogramming the PLL
feeding the CPU, so we don't have to worry about this in the
cpufreq driver. For now this is only used on MX53, but looking
forward the same approach (and code) could be used on MX6.

The first patch allows cpufreq-cpu0 to deactivate OPPs where
the regulator isn't able to provide the required voltage. This
has been tested on custom a MX53 board.

Lucas Stach (5):
  cpufreq: cpu0: disable unsupported OPPs
  clk: imx5: add step clock, used when reprogramming PLL1
  clk: imx: add CPU clock type
  arm: imx53: clk: add ARM clock
  ARM: imx53: add cpufreq support

 arch/arm/boot/dts/imx53.dtsi           |  13 ++++-
 arch/arm/mach-imx/Makefile             |   2 +-
 arch/arm/mach-imx/clk-cpu.c            | 104 +++++++++++++++++++++++++++++++++
 arch/arm/mach-imx/clk-imx51-imx53.c    |  14 ++++-
 arch/arm/mach-imx/clk.h                |   4 ++
 arch/arm/mach-imx/mach-imx53.c         |   4 ++
 drivers/cpufreq/cpufreq-cpu0.c         |  60 +++++++++++--------
 include/dt-bindings/clock/imx5-clock.h |   5 +-
 8 files changed, 179 insertions(+), 27 deletions(-)
(Continue reading)

Amit Pundir | 19 Sep 01:27 2014

[PATCH v2] PM: Print wall time at suspend entry and exit

From: Todd Poynor <toddpoynor <at> google.com>

Existing timestamps in a dmesg only log suspend activities
(e.g. filesystem syncs, freezing/unfreezing tasks etc) while the
system has already started to enter/exit the suspend state.

Sometimes it is handy to have suspend entry/exit overhead
information while debugging suspend issues. This patch print
markers with wall timestamps at suspend Entry and Exit in
the kernel log. These timestamps can be used to compute how
long the system spent in low-power suspend state plus the
entry/exit overhead.

Cc: Pavel Machek <pavel <at> ucw.cz>
Cc: Thomas Gleixner <tglx <at> linutronix.de>
Cc: Rafael J. Wysocki <rjw <at> rjwysocki.net>
Cc: Len Brown <len.brown <at> intel.com>
Cc: linux-pm <at> vger.kernel.org
Cc: Android Kernel Team <kernel-team <at> android.com>
Signed-off-by: Todd Poynor <toddpoynor <at> google.com>
[Amit Pundir: Reworded the commit message]
Signed-off-by: Amit Pundir <amit.pundir <at> linaro.org>
---
Resending this patch assuming that it might have got lost in between merge
window rush last time and now people might have some time to look at it.

 kernel/power/suspend.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c
(Continue reading)

Amit Pundir | 19 Sep 01:22 2014

[PATCH v2] PM: Print pending wakeup IRQ preventing suspend

From: Todd Poynor <toddpoynor <at> google.com>

Currently when a pending wakeup irq stops suspend, it can be difficult
to determine why suspend was prevented and which IRQ was actually
responsible. In order to help debug such situation, this patch prints the
IRQ number and action name of that pending wakeup irq.

Cc: Pavel Machek <pavel <at> ucw.cz>
Cc: Thomas Gleixner <tglx <at> linutronix.de>
Cc: Rafael J. Wysocki <rjw <at> rjwysocki.net>
Cc: Len Brown <len.brown <at> intel.com>
Cc: linux-pm <at> vger.kernel.org
Cc: Android Kernel Team <kernel-team <at> android.com>
Acked-by: Pavel Machek <pavel <at> ucw.cz>
Signed-off-by: Todd Poynor <toddpoynor <at> google.com>
[Amit Pundir: Reworded the commit message]
Signed-off-by: Amit Pundir <amit.pundir <at> linaro.org>
---
Resending this patch assuming that it might have got lost in between merge
window rush last time and now people might have some time to look at it.

 kernel/irq/pm.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/kernel/irq/pm.c b/kernel/irq/pm.c
index abcd6ca..c2bc8d9 100644
--- a/kernel/irq/pm.c
+++ b/kernel/irq/pm.c
 <at>  <at>  -109,8 +109,13  <at>  <at>  int check_wakeup_irqs(void)
 		 * can abort suspend.
(Continue reading)

Lan Tianyu | 18 Sep 09:03 2014
Picon

[PATCH 1/1] Cpufreq: Keep cpufreq sysfs nodes across S2RAM/S2DISK when using intel_pstate driver.

Cpufreq core introduces cpufreq_suspended flag to let cpufreq sysfs nodes
across S2RAM/S2DISK. But the flag is only set in the cpufreq_suspend()
for cpufreq drivers which have target or target_index callback. This
skips intel_pstate driver. This patch is to set the flag before checking
target or target_index callback.

Signed-off-by: Lan Tianyu <tianyu.lan <at> intel.com>
---
 drivers/cpufreq/cpufreq.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index d9fdedd..eb9bb78 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
 <at>  <at>  -1656,6 +1656,8  <at>  <at>  void cpufreq_suspend(void)
 	if (!cpufreq_driver)
 		return;

+	cpufreq_suspended = true;
+
 	if (!has_target())
 		return;

 <at>  <at>  -1670,8 +1672,6  <at>  <at>  void cpufreq_suspend(void)
 			pr_err("%s: Failed to suspend driver: %p\n", __func__,
 				policy);
 	}
-
-	cpufreq_suspended = true;
(Continue reading)

Zhang Rui | 18 Sep 03:53 2014
Picon

[PATCH 00/19] Thermal: ACPI INT340X thermal drivers

Hi,

Newer laptops and tablets that use ACPI may have thermal sensors and other
devices with thermal control capabilities outside the core CPU/SOC, for
thermal safety reasons.
They are exposed for the OS to use via the ACPI INT340x device objects.

This patch set introduces kernel drivers for those INT340X devices and
expose their telemetry and cooling capability to user space via the normal
thermal framework. So that a wide range of applications and GUI widgets
can show this information to the user or use this information for making
decisions. For example, the Intel Thermal Daemon can use this information
to allow the user to select his laptop to run w/ or w/o turning on the fans.

thanks,
rui

----------------------------------------------------------------
Aaron Lu (9):
      ACPI / fan: remove unused macro
      ACPI / fan: remove no need check for device pointer
      ACPI / fan: use acpi_device_xxx_power instead of acpi_bus equivelant
      ACPI / fan: convert to platform driver
      ACPI / Fan: add ACPI 4.0 style fan support
      ACPI / Fan: support INT3404 thermal device
      Thermal: move the KELVIN_TO_MILLICELSIUS macro to thermal.h
      Thermal: introduce INT3402 thermal driver
      Thermal: introduce INT3406 thermal driver

Jacob Pan (2):
(Continue reading)

Mark Brown | 17 Sep 20:34 2014

[PATCH] power/reset: xgene-reset: Fix prototype of xgene_restart()

From: Mark Brown <broonie <at> linaro.org>

The xgene-reset driver uses xgene_restart() as arm_pm_restart() but that
function should take an enum reset_type as the first argument rather than
a char. Fix this; the paramter is not referenced in the implementation.

Signed-off-by: Mark Brown <broonie <at> linaro.org>
---
 drivers/power/reset/xgene-reboot.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/power/reset/xgene-reboot.c b/drivers/power/reset/xgene-reboot.c
index ecd55f8..6b49be6 100644
--- a/drivers/power/reset/xgene-reboot.c
+++ b/drivers/power/reset/xgene-reboot.c
 <at>  <at>  -40,7 +40,7  <at>  <at>  struct xgene_reboot_context {

 static struct xgene_reboot_context *xgene_restart_ctx;

-static void xgene_restart(char str, const char *cmd)
+static void xgene_restart(enum reboot_mode mode, const char *cmd)
 {
 	struct xgene_reboot_context *ctx = xgene_restart_ctx;
 	unsigned long timeout;
--

-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo <at> vger.kernel.org
(Continue reading)


Gmane