Commit d6498af5 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull more power management updates from Rafael Wysocki:
 "These improve hybrid processors support in intel_pstate, fix an issue
  in the core devices PM code, clean up the handling of dedicated wake
  IRQs, update the Energy Model documentation and update MAINTAINERS.

  Specifics:

   - Make the HWP performance levels calibration on hybrid processors in
     intel_pstate more straightforward (Rafael Wysocki).

   - Prevent the PM core from leaving devices in suspend after a failing
     system-wide suspend transition in some cases when driver PM flags
     are used (Prasad Sodagudi).

   - Drop unused function argument from the dedicated wake IRQs handling
     code (Sergey Shtylyov).

   - Fix up Energy Model kerneldoc comments and include them in the
     Energy Model documentation (Lukasz Luba).

   - Use my kernel.org address in MAINTAINERS insead of the personal one
     (Rafael Wysocki)"

* tag 'pm-5.15-rc1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  MAINTAINERS: Change Rafael's e-mail address
  PM: sleep: core: Avoid setting power.must_resume to false
  Documentation: power: include kernel-doc in Energy Model doc
  PM: EM: fix kernel-doc comments
  cpufreq: intel_pstate: hybrid: Rework HWP calibration
  ACPI: CPPC: Introduce cppc_get_nominal_perf()
  PM: sleep: wakeirq: drop useless parameter from dev_pm_attach_wake_irq()
parents e99f23c5 be2d2433
Loading
Loading
Loading
Loading
+12 −3
Original line number Original line Diff line number Diff line
@@ -101,8 +101,7 @@ subsystems which use EM might rely on this flag to check if all EM devices use
the same scale. If there are different scales, these subsystems might decide
the same scale. If there are different scales, these subsystems might decide
to: return warning/error, stop working or panic.
to: return warning/error, stop working or panic.
See Section 3. for an example of driver implementing this
See Section 3. for an example of driver implementing this
callback, and kernel/power/energy_model.c for further documentation on this
callback, or Section 2.4 for further documentation on this API
API.




2.3 Accessing performance domains
2.3 Accessing performance domains
@@ -123,7 +122,17 @@ em_cpu_energy() API. The estimation is performed assuming that the schedutil
CPUfreq governor is in use in case of CPU device. Currently this calculation is
CPUfreq governor is in use in case of CPU device. Currently this calculation is
not provided for other type of devices.
not provided for other type of devices.


More details about the above APIs can be found in include/linux/energy_model.h.
More details about the above APIs can be found in ``<linux/energy_model.h>``
or in Section 2.4


2.4 Description details of this API
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. kernel-doc:: include/linux/energy_model.h
   :internal:

.. kernel-doc:: kernel/power/energy_model.c
   :export:




3. Example driver
3. Example driver
+10 −10
Original line number Original line Diff line number Diff line
@@ -333,7 +333,7 @@ S: Maintained
F:	drivers/platform/x86/acer-wmi.c
F:	drivers/platform/x86/acer-wmi.c
ACPI
ACPI
M:	"Rafael J. Wysocki" <rjw@rjwysocki.net>
M:	"Rafael J. Wysocki" <rafael@kernel.org>
M:	Len Brown <lenb@kernel.org>
M:	Len Brown <lenb@kernel.org>
L:	linux-acpi@vger.kernel.org
L:	linux-acpi@vger.kernel.org
S:	Supported
S:	Supported
@@ -354,7 +354,7 @@ F: include/linux/fwnode.h
F:	tools/power/acpi/
F:	tools/power/acpi/
ACPI APEI
ACPI APEI
M:	"Rafael J. Wysocki" <rjw@rjwysocki.net>
M:	"Rafael J. Wysocki" <rafael@kernel.org>
M:	Len Brown <lenb@kernel.org>
M:	Len Brown <lenb@kernel.org>
R:	James Morse <james.morse@arm.com>
R:	James Morse <james.morse@arm.com>
R:	Tony Luck <tony.luck@intel.com>
R:	Tony Luck <tony.luck@intel.com>
@@ -403,7 +403,7 @@ S: Maintained
F:	drivers/platform/x86/i2c-multi-instantiate.c
F:	drivers/platform/x86/i2c-multi-instantiate.c
ACPI PMIC DRIVERS
ACPI PMIC DRIVERS
M:	"Rafael J. Wysocki" <rjw@rjwysocki.net>
M:	"Rafael J. Wysocki" <rafael@kernel.org>
M:	Len Brown <lenb@kernel.org>
M:	Len Brown <lenb@kernel.org>
R:	Andy Shevchenko <andy@kernel.org>
R:	Andy Shevchenko <andy@kernel.org>
R:	Mika Westerberg <mika.westerberg@linux.intel.com>
R:	Mika Westerberg <mika.westerberg@linux.intel.com>
@@ -4827,7 +4827,7 @@ W: http://www.arm.com/products/processors/technologies/biglittleprocessing.php
F:	drivers/cpufreq/vexpress-spc-cpufreq.c
F:	drivers/cpufreq/vexpress-spc-cpufreq.c
CPU FREQUENCY SCALING FRAMEWORK
CPU FREQUENCY SCALING FRAMEWORK
M:	"Rafael J. Wysocki" <rjw@rjwysocki.net>
M:	"Rafael J. Wysocki" <rafael@kernel.org>
M:	Viresh Kumar <viresh.kumar@linaro.org>
M:	Viresh Kumar <viresh.kumar@linaro.org>
L:	linux-pm@vger.kernel.org
L:	linux-pm@vger.kernel.org
S:	Maintained
S:	Maintained
@@ -4845,7 +4845,7 @@ F: kernel/sched/cpufreq*.c
F:	tools/testing/selftests/cpufreq/
F:	tools/testing/selftests/cpufreq/
CPU IDLE TIME MANAGEMENT FRAMEWORK
CPU IDLE TIME MANAGEMENT FRAMEWORK
M:	"Rafael J. Wysocki" <rjw@rjwysocki.net>
M:	"Rafael J. Wysocki" <rafael@kernel.org>
M:	Daniel Lezcano <daniel.lezcano@linaro.org>
M:	Daniel Lezcano <daniel.lezcano@linaro.org>
L:	linux-pm@vger.kernel.org
L:	linux-pm@vger.kernel.org
S:	Maintained
S:	Maintained
@@ -7591,7 +7591,7 @@ W: ftp://ftp.openlinux.org/pub/people/hch/vxfs
F:	fs/freevxfs/
F:	fs/freevxfs/
FREEZER
FREEZER
M:	"Rafael J. Wysocki" <rjw@rjwysocki.net>
M:	"Rafael J. Wysocki" <rafael@kernel.org>
M:	Pavel Machek <pavel@ucw.cz>
M:	Pavel Machek <pavel@ucw.cz>
L:	linux-pm@vger.kernel.org
L:	linux-pm@vger.kernel.org
S:	Supported
S:	Supported
@@ -7844,7 +7844,7 @@ S: Supported
F:	drivers/i2c/muxes/i2c-demux-pinctrl.c
F:	drivers/i2c/muxes/i2c-demux-pinctrl.c
GENERIC PM DOMAINS
GENERIC PM DOMAINS
M:	"Rafael J. Wysocki" <rjw@rjwysocki.net>
M:	"Rafael J. Wysocki" <rafael@kernel.org>
M:	Kevin Hilman <khilman@kernel.org>
M:	Kevin Hilman <khilman@kernel.org>
M:	Ulf Hansson <ulf.hansson@linaro.org>
M:	Ulf Hansson <ulf.hansson@linaro.org>
L:	linux-pm@vger.kernel.org
L:	linux-pm@vger.kernel.org
@@ -8310,7 +8310,7 @@ W: http://drama.obuda.kando.hu/~fero/cgi-bin/hgafb.shtml
F:	drivers/video/fbdev/hgafb.c
F:	drivers/video/fbdev/hgafb.c
HIBERNATION (aka Software Suspend, aka swsusp)
HIBERNATION (aka Software Suspend, aka swsusp)
M:	"Rafael J. Wysocki" <rjw@rjwysocki.net>
M:	"Rafael J. Wysocki" <rafael@kernel.org>
M:	Pavel Machek <pavel@ucw.cz>
M:	Pavel Machek <pavel@ucw.cz>
L:	linux-pm@vger.kernel.org
L:	linux-pm@vger.kernel.org
S:	Supported
S:	Supported
@@ -14969,7 +14969,7 @@ F: kernel/time/*timer*
F:	kernel/time/namespace.c
F:	kernel/time/namespace.c
POWER MANAGEMENT CORE
POWER MANAGEMENT CORE
M:	"Rafael J. Wysocki" <rjw@rjwysocki.net>
M:	"Rafael J. Wysocki" <rafael@kernel.org>
L:	linux-pm@vger.kernel.org
L:	linux-pm@vger.kernel.org
S:	Supported
S:	Supported
B:	https://bugzilla.kernel.org
B:	https://bugzilla.kernel.org
@@ -17947,7 +17947,7 @@ F: arch/sh/
F:	drivers/sh/
F:	drivers/sh/
SUSPEND TO RAM
SUSPEND TO RAM
M:	"Rafael J. Wysocki" <rjw@rjwysocki.net>
M:	"Rafael J. Wysocki" <rafael@kernel.org>
M:	Len Brown <len.brown@intel.com>
M:	Len Brown <len.brown@intel.com>
M:	Pavel Machek <pavel@ucw.cz>
M:	Pavel Machek <pavel@ucw.cz>
L:	linux-pm@vger.kernel.org
L:	linux-pm@vger.kernel.org
+31 −16
Original line number Original line Diff line number Diff line
@@ -1008,23 +1008,14 @@ static int cpc_write(int cpu, struct cpc_register_resource *reg_res, u64 val)
	return ret_val;
	return ret_val;
}
}


/**
static int cppc_get_perf(int cpunum, enum cppc_regs reg_idx, u64 *perf)
 * cppc_get_desired_perf - Get the value of desired performance register.
 * @cpunum: CPU from which to get desired performance.
 * @desired_perf: address of a variable to store the returned desired performance
 *
 * Return: 0 for success, -EIO otherwise.
 */
int cppc_get_desired_perf(int cpunum, u64 *desired_perf)
{
{
	struct cpc_desc *cpc_desc = per_cpu(cpc_desc_ptr, cpunum);
	struct cpc_desc *cpc_desc = per_cpu(cpc_desc_ptr, cpunum);
	struct cpc_register_resource *reg = &cpc_desc->cpc_regs[reg_idx];

	if (CPC_IN_PCC(reg)) {
		int pcc_ss_id = per_cpu(cpu_pcc_subspace_idx, cpunum);
		int pcc_ss_id = per_cpu(cpu_pcc_subspace_idx, cpunum);
	struct cpc_register_resource *desired_reg;
		struct cppc_pcc_data *pcc_ss_data = NULL;
		struct cppc_pcc_data *pcc_ss_data = NULL;

	desired_reg = &cpc_desc->cpc_regs[DESIRED_PERF];

	if (CPC_IN_PCC(desired_reg)) {
		int ret = 0;
		int ret = 0;


		if (pcc_ss_id < 0)
		if (pcc_ss_id < 0)
@@ -1035,7 +1026,7 @@ int cppc_get_desired_perf(int cpunum, u64 *desired_perf)
		down_write(&pcc_ss_data->pcc_lock);
		down_write(&pcc_ss_data->pcc_lock);


		if (send_pcc_cmd(pcc_ss_id, CMD_READ) >= 0)
		if (send_pcc_cmd(pcc_ss_id, CMD_READ) >= 0)
			cpc_read(cpunum, desired_reg, desired_perf);
			cpc_read(cpunum, reg, perf);
		else
		else
			ret = -EIO;
			ret = -EIO;


@@ -1044,12 +1035,36 @@ int cppc_get_desired_perf(int cpunum, u64 *desired_perf)
		return ret;
		return ret;
	}
	}


	cpc_read(cpunum, desired_reg, desired_perf);
	cpc_read(cpunum, reg, perf);


	return 0;
	return 0;
}
}

/**
 * cppc_get_desired_perf - Get the desired performance register value.
 * @cpunum: CPU from which to get desired performance.
 * @desired_perf: Return address.
 *
 * Return: 0 for success, -EIO otherwise.
 */
int cppc_get_desired_perf(int cpunum, u64 *desired_perf)
{
	return cppc_get_perf(cpunum, DESIRED_PERF, desired_perf);
}
EXPORT_SYMBOL_GPL(cppc_get_desired_perf);
EXPORT_SYMBOL_GPL(cppc_get_desired_perf);


/**
 * cppc_get_nominal_perf - Get the nominal performance register value.
 * @cpunum: CPU from which to get nominal performance.
 * @nominal_perf: Return address.
 *
 * Return: 0 for success, -EIO otherwise.
 */
int cppc_get_nominal_perf(int cpunum, u64 *nominal_perf)
{
	return cppc_get_perf(cpunum, NOMINAL_PERF, nominal_perf);
}

/**
/**
 * cppc_get_perf_caps - Get a CPU's performance capabilities.
 * cppc_get_perf_caps - Get a CPU's performance capabilities.
 * @cpunum: CPU from which to get capabilities info.
 * @cpunum: CPU from which to get capabilities info.
+1 −1
Original line number Original line Diff line number Diff line
@@ -1642,7 +1642,7 @@ static int __device_suspend(struct device *dev, pm_message_t state, bool async)
	}
	}


	dev->power.may_skip_resume = true;
	dev->power.may_skip_resume = true;
	dev->power.must_resume = false;
	dev->power.must_resume = !dev_pm_test_driver_flags(dev, DPM_FLAG_MAY_SKIP_RESUME);


	dpm_watchdog_set(&wd, dev);
	dpm_watchdog_set(&wd, dev);
	device_lock(dev);
	device_lock(dev);
+4 −7
Original line number Original line Diff line number Diff line
@@ -12,14 +12,11 @@
/**
/**
 * dev_pm_attach_wake_irq - Attach device interrupt as a wake IRQ
 * dev_pm_attach_wake_irq - Attach device interrupt as a wake IRQ
 * @dev: Device entry
 * @dev: Device entry
 * @irq: Device wake-up capable interrupt
 * @wirq: Wake irq specific data
 * @wirq: Wake irq specific data
 *
 *
 * Internal function to attach either a device IO interrupt or a
 * Internal function to attach a dedicated wake-up interrupt as a wake IRQ.
 * dedicated wake-up interrupt as a wake IRQ.
 */
 */
static int dev_pm_attach_wake_irq(struct device *dev, int irq,
static int dev_pm_attach_wake_irq(struct device *dev, struct wake_irq *wirq)
				  struct wake_irq *wirq)
{
{
	unsigned long flags;
	unsigned long flags;


@@ -65,7 +62,7 @@ int dev_pm_set_wake_irq(struct device *dev, int irq)
	wirq->dev = dev;
	wirq->dev = dev;
	wirq->irq = irq;
	wirq->irq = irq;


	err = dev_pm_attach_wake_irq(dev, irq, wirq);
	err = dev_pm_attach_wake_irq(dev, wirq);
	if (err)
	if (err)
		kfree(wirq);
		kfree(wirq);


@@ -196,7 +193,7 @@ int dev_pm_set_dedicated_wake_irq(struct device *dev, int irq)
	if (err)
	if (err)
		goto err_free_name;
		goto err_free_name;


	err = dev_pm_attach_wake_irq(dev, irq, wirq);
	err = dev_pm_attach_wake_irq(dev, wirq);
	if (err)
	if (err)
		goto err_free_irq;
		goto err_free_irq;


Loading