Skip to content

Commit a6d6590

Browse files
committed
Merge branches 'pm-em', 'pm-powercap' and 'pm-sleep'
Merge additional updates related to the Energy Model, power capping and system-wide power management for 6.9-rc1: - Modify the Energy Model code to bail out and complain if the unit of power is not uW to prevent errors due to unit mismatches (Lukasz Luba). - Make the intel_rapl platform driver use a remove callback returning void (Uwe Kleine-König). - Fix typo in the suspend and interrupts document (Saravana Kannan). * pm-em: PM: EM: Force device drivers to provide power in uW * pm-powercap: powercap: intel_rapl: Convert to platform remove callback returning void * pm-sleep: Documentation: power: Fix typo in suspend and interrupts doc
4 parents 11703c7 + 3acec69 + 52b43bb + d61120b commit a6d6590

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

Documentation/power/suspend-and-interrupts.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ handling the given IRQ as a system wakeup interrupt line and disable_irq_wake()
7878
turns that logic off.
7979

8080
Calling enable_irq_wake() causes suspend_device_irqs() to treat the given IRQ
81-
in a special way. Namely, the IRQ remains enabled, by on the first interrupt
81+
in a special way. Namely, the IRQ remains enabled, but on the first interrupt
8282
it will be disabled, marked as pending and "suspended" so that it will be
8383
re-enabled by resume_device_irqs() during the subsequent system resume. Also
8484
the PM core is notified about the event which causes the system suspend in

drivers/powercap/intel_rapl_msr.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,11 +197,10 @@ static int rapl_msr_probe(struct platform_device *pdev)
197197
return ret;
198198
}
199199

200-
static int rapl_msr_remove(struct platform_device *pdev)
200+
static void rapl_msr_remove(struct platform_device *pdev)
201201
{
202202
cpuhp_remove_state(rapl_msr_priv->pcap_rapl_online);
203203
powercap_unregister_control_type(rapl_msr_priv->control_type);
204-
return 0;
205204
}
206205

207206
static const struct platform_device_id rapl_msr_ids[] = {
@@ -212,7 +211,7 @@ MODULE_DEVICE_TABLE(platform, rapl_msr_ids);
212211

213212
static struct platform_driver intel_rapl_msr_driver = {
214213
.probe = rapl_msr_probe,
215-
.remove = rapl_msr_remove,
214+
.remove_new = rapl_msr_remove,
216215
.id_table = rapl_msr_ids,
217216
.driver = {
218217
.name = "intel_rapl_msr",

kernel/power/energy_model.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -612,6 +612,17 @@ int em_dev_register_perf_domain(struct device *dev, unsigned int nr_states,
612612
else if (cb->get_cost)
613613
flags |= EM_PERF_DOMAIN_ARTIFICIAL;
614614

615+
/*
616+
* EM only supports uW (exception is artificial EM).
617+
* Therefore, check and force the drivers to provide
618+
* power in uW.
619+
*/
620+
if (!microwatts && !(flags & EM_PERF_DOMAIN_ARTIFICIAL)) {
621+
dev_err(dev, "EM: only supports uW power values\n");
622+
ret = -EINVAL;
623+
goto unlock;
624+
}
625+
615626
ret = em_create_pd(dev, nr_states, cb, cpus, flags);
616627
if (ret)
617628
goto unlock;

0 commit comments

Comments
 (0)