-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PM / Domains: Add device stop governor function (v4)
Add a function deciding whether or not devices should be stopped in pm_genpd_runtime_suspend() depending on their PM QoS constraints and stop/start timing values. Make it possible to add information used by this function to device objects. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Acked-by: Magnus Damm <damm@opensource.se>
- Loading branch information
Rafael J. Wysocki
committed
Dec 1, 2011
1 parent
d23b9b0
commit b02c999
Showing
5 changed files
with
118 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* drivers/base/power/domain_governor.c - Governors for device PM domains. | ||
* | ||
* Copyright (C) 2011 Rafael J. Wysocki <rjw@sisk.pl>, Renesas Electronics Corp. | ||
* | ||
* This file is released under the GPLv2. | ||
*/ | ||
|
||
#include <linux/init.h> | ||
#include <linux/kernel.h> | ||
#include <linux/pm_domain.h> | ||
#include <linux/pm_qos.h> | ||
|
||
/** | ||
* default_stop_ok - Default PM domain governor routine for stopping devices. | ||
* @dev: Device to check. | ||
*/ | ||
bool default_stop_ok(struct device *dev) | ||
{ | ||
struct gpd_timing_data *td = &dev_gpd_data(dev)->td; | ||
|
||
dev_dbg(dev, "%s()\n", __func__); | ||
|
||
if (dev->power.max_time_suspended_ns < 0 || td->break_even_ns == 0) | ||
return true; | ||
|
||
return td->stop_latency_ns + td->start_latency_ns < td->break_even_ns | ||
&& td->break_even_ns < dev->power.max_time_suspended_ns; | ||
} | ||
|
||
struct dev_power_governor simple_qos_governor = { | ||
.stop_ok = default_stop_ok, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters