Commit 1225bb42 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki
Browse files

Merge branches 'pm-sleep', 'pm-cpuidle' and 'pm-em'

Merge updates related to system sleep, a cpuidle update and an Energy
Model handling code update for 6.14-rc1:

 - Allow configuring the system suspend-resume (DPM) watchdog to warn
   earlier than panic (Douglas Anderson).

 - Implement devm_device_init_wakeup() helper and introduce a device-
   managed variant of dev_pm_set_wake_irq() (Joe Hattori, Peng Fan).

 - Remove direct inclusions of 'pm_wakeup.h' which should be only
   included via 'device.h' (Wolfram Sang).

 - Clean up two comments in the core system-wide PM code (Rafael
   Wysocki, Randy Dunlap).

 - Add Clearwater Forest processor support to the intel_idle cpuidle
   driver (Artem Bityutskiy).

 - Move sched domains rebuild function from the schedutil cpufreq
   governor to the Energy Model handling code (Rafael Wysocki).

* pm-sleep:
  PM: sleep: wakeirq: Introduce device-managed variant of dev_pm_set_wake_irq()
  PM: sleep: Allow configuring the DPM watchdog to warn earlier than panic
  PM: sleep: convert comment from kernel-doc to plain comment
  PM: wakeup: implement devm_device_init_wakeup() helper
  PM: sleep: sysfs: don't include 'pm_wakeup.h' directly
  PM: sleep: autosleep: don't include 'pm_wakeup.h' directly
  PM: sleep: Update stale comment in device_resume()

* pm-cpuidle:
  intel_idle: add Clearwater Forest SoC support

* pm-em:
  PM: EM: Move sched domains rebuild function from schedutil to EM
Loading
Loading
Loading
Loading
+20 −6
Original line number Diff line number Diff line
@@ -496,6 +496,7 @@ struct dpm_watchdog {
	struct device		*dev;
	struct task_struct	*tsk;
	struct timer_list	timer;
	bool			fatal;
};

#define DECLARE_DPM_WATCHDOG_ON_STACK(wd) \
@@ -512,13 +513,25 @@ struct dpm_watchdog {
static void dpm_watchdog_handler(struct timer_list *t)
{
	struct dpm_watchdog *wd = from_timer(wd, t, timer);
	struct timer_list *timer = &wd->timer;
	unsigned int time_left;

	if (wd->fatal) {
		dev_emerg(wd->dev, "**** DPM device timeout ****\n");
		show_stack(wd->tsk, NULL, KERN_EMERG);
		panic("%s %s: unrecoverable failure\n",
			dev_driver_string(wd->dev), dev_name(wd->dev));
	}

	time_left = CONFIG_DPM_WATCHDOG_TIMEOUT - CONFIG_DPM_WATCHDOG_WARNING_TIMEOUT;
	dev_warn(wd->dev, "**** DPM device timeout after %u seconds; %u seconds until panic ****\n",
		 CONFIG_DPM_WATCHDOG_WARNING_TIMEOUT, time_left);
	show_stack(wd->tsk, NULL, KERN_WARNING);

	wd->fatal = true;
	mod_timer(timer, jiffies + HZ * time_left);
}

/**
 * dpm_watchdog_set - Enable pm watchdog for given device.
 * @wd: Watchdog. Must be allocated on the stack.
@@ -530,10 +543,11 @@ static void dpm_watchdog_set(struct dpm_watchdog *wd, struct device *dev)

	wd->dev = dev;
	wd->tsk = current;
	wd->fatal = CONFIG_DPM_WATCHDOG_TIMEOUT == CONFIG_DPM_WATCHDOG_WARNING_TIMEOUT;

	timer_setup_on_stack(timer, dpm_watchdog_handler, 0);
	/* use same timeout value for both suspend and resume */
	timer->expires = jiffies + HZ * CONFIG_DPM_WATCHDOG_TIMEOUT;
	timer->expires = jiffies + HZ * CONFIG_DPM_WATCHDOG_WARNING_TIMEOUT;
	add_timer(timer);
}

@@ -914,7 +928,7 @@ static void device_resume(struct device *dev, pm_message_t state, bool async)
		goto Complete;

	if (dev->power.direct_complete) {
		/* Match the pm_runtime_disable() in __device_suspend(). */
		/* Match the pm_runtime_disable() in device_suspend(). */
		pm_runtime_enable(dev);
		goto Complete;
	}
+0 −1
Original line number Diff line number Diff line
@@ -6,7 +6,6 @@
#include <linux/export.h>
#include <linux/pm_qos.h>
#include <linux/pm_runtime.h>
#include <linux/pm_wakeup.h>
#include <linux/atomic.h>
#include <linux/jiffies.h>
#include "power.h"
+26 −0
Original line number Diff line number Diff line
@@ -103,6 +103,32 @@ void dev_pm_clear_wake_irq(struct device *dev)
}
EXPORT_SYMBOL_GPL(dev_pm_clear_wake_irq);

static void devm_pm_clear_wake_irq(void *dev)
{
	dev_pm_clear_wake_irq(dev);
}

/**
 * devm_pm_set_wake_irq - device-managed variant of dev_pm_set_wake_irq
 * @dev: Device entry
 * @irq: Device IO interrupt
 *
 *
 * Attach a device IO interrupt as a wake IRQ, same with dev_pm_set_wake_irq,
 * but the device will be auto clear wake capability on driver detach.
 */
int devm_pm_set_wake_irq(struct device *dev, int irq)
{
	int ret;

	ret = dev_pm_set_wake_irq(dev, irq);
	if (ret)
		return ret;

	return devm_add_action_or_reset(dev, devm_pm_clear_wake_irq, dev);
}
EXPORT_SYMBOL_GPL(devm_pm_set_wake_irq);

/**
 * handle_threaded_wake_irq - Handler for dedicated wake-up interrupts
 * @irq: Device specific dedicated wake-up interrupt
+1 −1
Original line number Diff line number Diff line
@@ -1538,7 +1538,7 @@ static int cpufreq_online(unsigned int cpu)

		/*
		 * Register with the energy model before
		 * sugov_eas_rebuild_sd() is called, which will result
		 * em_rebuild_sched_domains() is called, which will result
		 * in rebuilding of the sched domains, which should only be done
		 * once the energy model is properly initialized for the policy
		 * first.
+1 −0
Original line number Diff line number Diff line
@@ -1651,6 +1651,7 @@ static const struct x86_cpu_id intel_idle_ids[] __initconst = {
	X86_MATCH_VFM(INTEL_ATOM_TREMONT_D,	&idle_cpu_snr),
	X86_MATCH_VFM(INTEL_ATOM_CRESTMONT,	&idle_cpu_grr),
	X86_MATCH_VFM(INTEL_ATOM_CRESTMONT_X,	&idle_cpu_srf),
	X86_MATCH_VFM(INTEL_ATOM_DARKMONT_X,	&idle_cpu_srf),
	{}
};

Loading