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
83 unsigned int use_deepest_state:1;83 unsigned int use_deepest_state:1;
84 unsigned int poll_time_limit:1;84 unsigned int poll_time_limit:1;
85 unsigned int cpu;85 unsigned int cpu;
86 ktime_t next_hrtimer;
86 87
87 int last_residency;88 int last_residency;
88 struct cpuidle_state_usage states_usage[CPUIDLE_STATE_MAX];89 struct cpuidle_state_usage states_usage[CPUIDLE_STATE_MAX];
include/linux/pm_domain.h+20−1
@@ -16,6 +16,7 @@ · 15 unmodified lines
16#include <linux/of.h>16#include <linux/of.h>
17#include <linux/notifier.h>17#include <linux/notifier.h>
18#include <linux/spinlock.h>18#include <linux/spinlock.h>
19#include <linux/cpumask.h>
19 20
20/*21/*
21 * Flags to control the behaviour of a genpd.22 * Flags to control the behaviour of a genpd.
@@ -42,11 +43,22 @@ · 20 unmodified lines
42 * GENPD_FLAG_ACTIVE_WAKEUP: Instructs genpd to keep the PM domain powered43 * GENPD_FLAG_ACTIVE_WAKEUP: Instructs genpd to keep the PM domain powered
43 * on, in case any of its attached devices is used44 * on, in case any of its attached devices is used
44 * in the wakeup path to serve system wakeups.45 * 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.
45 */56 */
46#define GENPD_FLAG_PM_CLK (1U << 0)57#define GENPD_FLAG_PM_CLK (1U << 0)
47#define GENPD_FLAG_IRQ_SAFE (1U << 1)58#define GENPD_FLAG_IRQ_SAFE (1U << 1)
48#define GENPD_FLAG_ALWAYS_ON (1U << 2)59#define GENPD_FLAG_ALWAYS_ON (1U << 2)
49#define GENPD_FLAG_ACTIVE_WAKEUP (1U << 3)60#define GENPD_FLAG_ACTIVE_WAKEUP (1U << 3)
61#define GENPD_FLAG_CPU_DOMAIN (1U << 4)
50 62
51enum gpd_status {63enum gpd_status {
52 GPD_STATE_ACTIVE = 0, /* PM domain is active */64 GPD_STATE_ACTIVE = 0, /* PM domain is active */
@@ -69,6 +81,7 @@ struct genpd_power_state { · 16 unmodified lines
69 s64 residency_ns;81 s64 residency_ns;
70 struct fwnode_handle *fwnode;82 struct fwnode_handle *fwnode;
71 ktime_t idle_time;83 ktime_t idle_time;
84 void *data;
72};85};
73 86
74struct genpd_lock_ops;87struct genpd_lock_ops;
@@ -93,6 +106,7 @@ struct generic_pm_domain { · 18 unmodified lines
93 unsigned int suspended_count; /* System suspend device counter */106 unsigned int suspended_count; /* System suspend device counter */
94 unsigned int prepared_count; /* Suspend counter of prepared devices */107 unsigned int prepared_count; /* Suspend counter of prepared devices */
95 unsigned int performance_state; /* Aggregated max performance state */108 unsigned int performance_state; /* Aggregated max performance state */
109 cpumask_var_t cpus; /* A cpumask of the attached CPUs */
96 int (*power_off)(struct generic_pm_domain *domain);110 int (*power_off)(struct generic_pm_domain *domain);
97 int (*power_on)(struct generic_pm_domain *domain);111 int (*power_on)(struct generic_pm_domain *domain);
98 struct opp_table *opp_table; /* OPP table of the genpd */112 struct opp_table *opp_table; /* OPP table of the genpd */
@@ -104,15 +118,17 @@ struct generic_pm_domain { · 5 unmodified lines
104 s64 max_off_time_ns; /* Maximum allowed "suspended" time. */118 s64 max_off_time_ns; /* Maximum allowed "suspended" time. */
105 bool max_off_time_changed;119 bool max_off_time_changed;
106 bool cached_power_down_ok;120 bool cached_power_down_ok;
121 bool cached_power_down_state_idx;
107 int (*attach_dev)(struct generic_pm_domain *domain,122 int (*attach_dev)(struct generic_pm_domain *domain,
108 struct device *dev);123 struct device *dev);
109 void (*detach_dev)(struct generic_pm_domain *domain,124 void (*detach_dev)(struct generic_pm_domain *domain,
110 struct device *dev);125 struct device *dev);
111 unsigned int flags; /* Bit field of configs for genpd */126 unsigned int flags; /* Bit field of configs for genpd */
112 struct genpd_power_state *states;127 struct genpd_power_state *states;
128 void (*free_states)(struct genpd_power_state *states,
129 unsigned int state_count);
113 unsigned int state_count; /* number of states */130 unsigned int state_count; /* number of states */
114 unsigned int state_idx; /* state that genpd will go to when off */131 unsigned int state_idx; /* state that genpd will go to when off */
115 void *free; /* Free the state that was allocated for default */
116 ktime_t on_time;132 ktime_t on_time;
117 ktime_t accounting_time;133 ktime_t accounting_time;
118 const struct genpd_lock_ops *lock_ops;134 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
187 203
188extern struct dev_power_governor simple_qos_governor;204extern struct dev_power_governor simple_qos_governor;
189extern struct dev_power_governor pm_domain_always_on_gov;205extern struct dev_power_governor pm_domain_always_on_gov;
206#ifdef CONFIG_CPU_IDLE
207extern struct dev_power_governor pm_domain_cpu_gov;
208#endif
190#else209#else
191 210
192static inline struct generic_pm_domain_data *dev_gpd_data(struct device *dev)211static 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
122extern void tick_nohz_idle_exit(void);122extern void tick_nohz_idle_exit(void);
123extern void tick_nohz_irq_exit(void);123extern void tick_nohz_irq_exit(void);
124extern bool tick_nohz_idle_got_tick(void);124extern bool tick_nohz_idle_got_tick(void);
125extern ktime_t tick_nohz_get_next_hrtimer(void);
125extern ktime_t tick_nohz_get_sleep_length(ktime_t *delta_next);126extern ktime_t tick_nohz_get_sleep_length(ktime_t *delta_next);
126extern unsigned long tick_nohz_get_idle_calls(void);127extern unsigned long tick_nohz_get_idle_calls(void);
127extern unsigned long tick_nohz_get_idle_calls_cpu(int cpu);128extern 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
145static inline void tick_nohz_idle_enter(void) { }146static inline void tick_nohz_idle_enter(void) { }
146static inline void tick_nohz_idle_exit(void) { }147static inline void tick_nohz_idle_exit(void) { }
147static inline bool tick_nohz_idle_got_tick(void) { return false; }148static inline bool tick_nohz_idle_got_tick(void) { return false; }
148 149static 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}
149static inline ktime_t tick_nohz_get_sleep_length(ktime_t *delta_next)154static inline ktime_t tick_nohz_get_sleep_length(ktime_t *delta_next)
150{155{
151 *delta_next = TICK_NSEC;156 *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