History

Merge tag 'pm-5.5-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull additional power management updates from Rafael Wysocki: "These fix an ACPI EC driver bug exposed by the recent rework of the suspend-to-idle code flow, reintroduce frequency constraints into device PM QoS (in preparation for adding QoS support to devfreq), drop a redundant field from struct cpuidle_state and clean up Kconfig in some places. Specifics: - Avoid a race condition in the ACPI EC driver that may cause systems to be unable to leave suspend-to-idle (Rafael Wysocki) - Drop the "disabled" field, which is redundant, from struct cpuidle_state (Rafael Wysocki) - Reintroduce device PM QoS frequency constraints (temporarily introduced and than dropped during the 5.4 cycle) in preparation for adding QoS support to devfreq (Leonard Crestez) - Clean up indentation (in multiple places) and the cpuidle drivers help text in Kconfig (Krzysztof Kozlowski, Randy Dunlap)" * tag 'pm-5.5-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: ACPI: PM: s2idle: Rework ACPI events synchronization ACPI: EC: Rework flushing of pending work PM / devfreq: Add missing locking while setting suspend_freq PM / QoS: Restore DEV_PM_QOS_MIN/MAX_FREQUENCY PM / QoS: Reorder pm_qos/freq_qos/dev_pm_qos structs PM / QoS: Initial kunit test PM / QoS: Redefine FREQ_QOS_MAX_DEFAULT_VALUE to S32_MAX power: avs: Fix Kconfig indentation cpufreq: Fix Kconfig indentation cpuidle: minor Kconfig help text fixes cpuidle: Drop disabled field from struct cpuidle_state cpuidle: Fix Kconfig indentation

Linus Torvalds committed 6 years ago

Commit ef867c12 parents 63de374 1e4230f19 files · +324 −120Browse files

Showing the changes to include/linux (2 of 19 files). Show all

Unified · Split

2 files
  1. include/linux/cpuidle.h +1 −1
  2. include/linux/pm_qos.h +50 −36
include/linux/cpuidle.h+1−1
@@ -54,7 +54,6 @@ struct cpuidle_state { · 53 unmodified lines
5454 unsigned int exit_latency; /* in US */
5555 int power_usage; /* in mW */
5656 unsigned int target_residency; /* in US */
57− bool disabled; /* disabled on all CPUs */
5857
5958 int (*enter) (struct cpuidle_device *dev,
6059 struct cpuidle_driver *drv,
@@ -77,6 +76,7 @@ struct cpuidle_state { · 16 unmodified lines
7776 #define CPUIDLE_FLAG_POLLING BIT(0) /* polling state */
7877 #define CPUIDLE_FLAG_COUPLED BIT(1) /* state applies to multiple cpus */
7978 #define CPUIDLE_FLAG_TIMER_STOP BIT(2) /* timer is stopped on this state */
79+#define CPUIDLE_FLAG_UNUSABLE BIT(3) /* avoid using this state */
8080
8181 struct cpuidle_device_kobj;
8282 struct cpuidle_state_kobj;
include/linux/pm_qos.h+50−36
@@ -34,6 +34,8 @@ enum pm_qos_flags_status { · 33 unmodified lines
3434 #define PM_QOS_RESUME_LATENCY_NO_CONSTRAINT PM_QOS_LATENCY_ANY
3535 #define PM_QOS_RESUME_LATENCY_NO_CONSTRAINT_NS PM_QOS_LATENCY_ANY_NS
3636 #define PM_QOS_LATENCY_TOLERANCE_DEFAULT_VALUE 0
37+#define PM_QOS_MIN_FREQUENCY_DEFAULT_VALUE 0
38+#define PM_QOS_MAX_FREQUENCY_DEFAULT_VALUE FREQ_QOS_MAX_DEFAULT_VALUE
3739 #define PM_QOS_LATENCY_TOLERANCE_NO_CONSTRAINT (-1)
3840
3941 #define PM_QOS_FLAG_NO_POWER_OFF (1 << 0)
@@ -49,21 +51,6 @@ struct pm_qos_flags_request { · 9 unmodified lines
4951 s32 flags; /* Do not change to 64 bit */
5052 };
5153
52−enum dev_pm_qos_req_type {
53− DEV_PM_QOS_RESUME_LATENCY = 1,
54− DEV_PM_QOS_LATENCY_TOLERANCE,
55− DEV_PM_QOS_FLAGS,
56−};
57−
58−struct dev_pm_qos_request {
59− enum dev_pm_qos_req_type type;
60− union {
61− struct plist_node pnode;
62− struct pm_qos_flags_request flr;
63− } data;
64− struct device *dev;
65−};
66−
6754 enum pm_qos_type {
6855 PM_QOS_UNITIALIZED,
6956 PM_QOS_MAX, /* return the largest value */
@@ -90,9 +77,51 @@ struct pm_qos_flags { · 20 unmodified lines
9077 s32 effective_flags; /* Do not change to 64 bit */
9178 };
9279
80+
81+#define FREQ_QOS_MIN_DEFAULT_VALUE 0
82+#define FREQ_QOS_MAX_DEFAULT_VALUE S32_MAX
83+
84+enum freq_qos_req_type {
85+ FREQ_QOS_MIN = 1,
86+ FREQ_QOS_MAX,
87+};
88+
89+struct freq_constraints {
90+ struct pm_qos_constraints min_freq;
91+ struct blocking_notifier_head min_freq_notifiers;
92+ struct pm_qos_constraints max_freq;
93+ struct blocking_notifier_head max_freq_notifiers;
94+};
95+
96+struct freq_qos_request {
97+ enum freq_qos_req_type type;
98+ struct plist_node pnode;
99+ struct freq_constraints *qos;
100+};
101+
102+
103+enum dev_pm_qos_req_type {
104+ DEV_PM_QOS_RESUME_LATENCY = 1,
105+ DEV_PM_QOS_LATENCY_TOLERANCE,
106+ DEV_PM_QOS_MIN_FREQUENCY,
107+ DEV_PM_QOS_MAX_FREQUENCY,
108+ DEV_PM_QOS_FLAGS,
109+};
110+
111+struct dev_pm_qos_request {
112+ enum dev_pm_qos_req_type type;
113+ union {
114+ struct plist_node pnode;
115+ struct pm_qos_flags_request flr;
116+ struct freq_qos_request freq;
117+ } data;
118+ struct device *dev;
119+};
120+
93121 struct dev_pm_qos {
94122 struct pm_qos_constraints resume_latency;
95123 struct pm_qos_constraints latency_tolerance;
124+ struct freq_constraints freq;
96125 struct pm_qos_flags flags;
97126 struct dev_pm_qos_request *resume_latency_req;
98127 struct dev_pm_qos_request *latency_tolerance_req;
@@ -191,6 +220,10 @@ static inline s32 dev_pm_qos_read_value(struct device *dev, · 92 unmodified lines
191220 switch (type) {
192221 case DEV_PM_QOS_RESUME_LATENCY:
193222 return PM_QOS_RESUME_LATENCY_NO_CONSTRAINT;
223+ case DEV_PM_QOS_MIN_FREQUENCY:
224+ return PM_QOS_MIN_FREQUENCY_DEFAULT_VALUE;
225+ case DEV_PM_QOS_MAX_FREQUENCY:
226+ return PM_QOS_MAX_FREQUENCY_DEFAULT_VALUE;
194227 default:
195228 WARN_ON(1);
196229 return 0;
@@ -255,27 +288,6 @@ static inline s32 dev_pm_qos_raw_resume_latency(struct device *dev) · 58 unmodified lines
255288 }
256289 #endif
257290
258−#define FREQ_QOS_MIN_DEFAULT_VALUE 0
259−#define FREQ_QOS_MAX_DEFAULT_VALUE (-1)
260−
261−enum freq_qos_req_type {
262− FREQ_QOS_MIN = 1,
263− FREQ_QOS_MAX,
264−};
265−
266−struct freq_constraints {
267− struct pm_qos_constraints min_freq;
268− struct blocking_notifier_head min_freq_notifiers;
269− struct pm_qos_constraints max_freq;
270− struct blocking_notifier_head max_freq_notifiers;
271−};
272−
273−struct freq_qos_request {
274− enum freq_qos_req_type type;
275− struct plist_node pnode;
276− struct freq_constraints *qos;
277−};
278−
279291 static inline int freq_qos_request_active(struct freq_qos_request *req)
280292 {
281293 return !IS_ERR_OR_NULL(req->qos);
@@ -291,6 +303,8 @@ int freq_qos_add_request(struct freq_constraints *qos, · 9 unmodified lines
291303 enum freq_qos_req_type type, s32 value);
292304 int freq_qos_update_request(struct freq_qos_request *req, s32 new_value);
293305 int freq_qos_remove_request(struct freq_qos_request *req);
306+int freq_qos_apply(struct freq_qos_request *req,
307+ enum pm_qos_req_action action, s32 value);
294308
295309 int freq_qos_add_notifier(struct freq_constraints *qos,
296310 enum freq_qos_req_type type,

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