History

Merge cpuidle material depended on by the subsequent changes.

Rafael J. Wysocki committed 7 years ago

Commit 40aa4db2 parents 3ccf3f0 e9499968 files · +197 −9Browse files

Showing the changes to include/linux (3 of 8 files). Show all

Unified · Split

3 files
  1. include/linux/cpuidle.h +1 −0
  2. include/linux/pm_domain.h +20 −1
  3. include/linux/tick.h +6 −1
include/linux/cpuidle.h+1−0
@@ -83,6 +83,7 @@ struct cpuidle_device { · 82 unmodified lines
8383 unsigned int use_deepest_state:1;
8484 unsigned int poll_time_limit:1;
8585 unsigned int cpu;
86+ ktime_t next_hrtimer;
8687
8788 int last_residency;
8889 struct cpuidle_state_usage states_usage[CPUIDLE_STATE_MAX];
include/linux/pm_domain.h+20−1
@@ -16,6 +16,7 @@ · 15 unmodified lines
1616 #include <linux/of.h>
1717 #include <linux/notifier.h>
1818 #include <linux/spinlock.h>
19+#include <linux/cpumask.h>
1920
2021 /*
2122 * Flags to control the behaviour of a genpd.
@@ -42,11 +43,22 @@ · 20 unmodified lines
4243 * GENPD_FLAG_ACTIVE_WAKEUP: Instructs genpd to keep the PM domain powered
4344 * on, in case any of its attached devices is used
4445 * in the wakeup path to serve system wakeups.
46+ *
47+ * GENPD_FLAG_CPU_DOMAIN: Instructs genpd that it should expect to get
48+ * devices attached, which may belong to CPUs or
49+ * possibly have subdomains with CPUs attached.
50+ * This flag enables the genpd backend driver to
51+ * deploy idle power management support for CPUs
52+ * and groups of CPUs. Note that, the backend
53+ * driver must then comply with the so called,
54+ * last-man-standing algorithm, for the CPUs in the
55+ * PM domain.
4556 */
4657 #define GENPD_FLAG_PM_CLK (1U << 0)
4758 #define GENPD_FLAG_IRQ_SAFE (1U << 1)
4859 #define GENPD_FLAG_ALWAYS_ON (1U << 2)
4960 #define GENPD_FLAG_ACTIVE_WAKEUP (1U << 3)
61+#define GENPD_FLAG_CPU_DOMAIN (1U << 4)
5062
5163 enum gpd_status {
5264 GPD_STATE_ACTIVE = 0, /* PM domain is active */
@@ -69,6 +81,7 @@ struct genpd_power_state { · 16 unmodified lines
6981 s64 residency_ns;
7082 struct fwnode_handle *fwnode;
7183 ktime_t idle_time;
84+ void *data;
7285 };
7386
7487 struct genpd_lock_ops;
@@ -93,6 +106,7 @@ struct generic_pm_domain { · 18 unmodified lines
93106 unsigned int suspended_count; /* System suspend device counter */
94107 unsigned int prepared_count; /* Suspend counter of prepared devices */
95108 unsigned int performance_state; /* Aggregated max performance state */
109+ cpumask_var_t cpus; /* A cpumask of the attached CPUs */
96110 int (*power_off)(struct generic_pm_domain *domain);
97111 int (*power_on)(struct generic_pm_domain *domain);
98112 struct opp_table *opp_table; /* OPP table of the genpd */
@@ -104,15 +118,17 @@ struct generic_pm_domain { · 5 unmodified lines
104118 s64 max_off_time_ns; /* Maximum allowed "suspended" time. */
105119 bool max_off_time_changed;
106120 bool cached_power_down_ok;
121+ bool cached_power_down_state_idx;
107122 int (*attach_dev)(struct generic_pm_domain *domain,
108123 struct device *dev);
109124 void (*detach_dev)(struct generic_pm_domain *domain,
110125 struct device *dev);
111126 unsigned int flags; /* Bit field of configs for genpd */
112127 struct genpd_power_state *states;
128+ void (*free_states)(struct genpd_power_state *states,
129+ unsigned int state_count);
113130 unsigned int state_count; /* number of states */
114131 unsigned int state_idx; /* state that genpd will go to when off */
115− void *free; /* Free the state that was allocated for default */
116132 ktime_t on_time;
117133 ktime_t accounting_time;
118134 const struct genpd_lock_ops *lock_ops;
@@ -187,6 +203,9 @@ int dev_pm_genpd_set_performance_state(struct device *dev, unsigned int state); · 68 unmodified lines
187203
188204 extern struct dev_power_governor simple_qos_governor;
189205 extern struct dev_power_governor pm_domain_always_on_gov;
206+#ifdef CONFIG_CPU_IDLE
207+extern struct dev_power_governor pm_domain_cpu_gov;
208+#endif
190209 #else
191210
192211 static inline struct generic_pm_domain_data *dev_gpd_data(struct device *dev)
include/linux/tick.h+6−1
@@ -122,6 +122,7 @@ extern void tick_nohz_idle_enter(void); · 121 unmodified lines
122122 extern void tick_nohz_idle_exit(void);
123123 extern void tick_nohz_irq_exit(void);
124124 extern bool tick_nohz_idle_got_tick(void);
125+extern ktime_t tick_nohz_get_next_hrtimer(void);
125126 extern ktime_t tick_nohz_get_sleep_length(ktime_t *delta_next);
126127 extern unsigned long tick_nohz_get_idle_calls(void);
127128 extern unsigned long tick_nohz_get_idle_calls_cpu(int cpu);
@@ -145,7 +146,11 @@ static inline void tick_nohz_idle_restart_tick(void) { } · 17 unmodified lines
145146 static inline void tick_nohz_idle_enter(void) { }
146147 static inline void tick_nohz_idle_exit(void) { }
147148 static inline bool tick_nohz_idle_got_tick(void) { return false; }
148−
149+static inline ktime_t tick_nohz_get_next_hrtimer(void)
150+{
151+ /* Next wake up is the tick period, assume it starts now */
152+ return ktime_add(ktime_get(), TICK_NSEC);
153+}
149154 static inline ktime_t tick_nohz_get_sleep_length(ktime_t *delta_next)
150155 {
151156 *delta_next = TICK_NSEC;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t