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
Showing the changes to include/linux (2 of 19 files). Show all
Unified · Split
| @@ -54,7 +54,6 @@ struct cpuidle_state { · 53 unmodified lines | |||
| 54 | unsigned int exit_latency; /* in US */ | 54 | unsigned int exit_latency; /* in US */ |
| 55 | int power_usage; /* in mW */ | 55 | int power_usage; /* in mW */ |
| 56 | unsigned int target_residency; /* in US */ | 56 | unsigned int target_residency; /* in US */ |
| 57 | bool disabled; /* disabled on all CPUs */ | ||
| 58 | 57 | ||
| 59 | int (*enter) (struct cpuidle_device *dev, | 58 | int (*enter) (struct cpuidle_device *dev, |
| 60 | struct cpuidle_driver *drv, | 59 | struct cpuidle_driver *drv, |
| @@ -77,6 +76,7 @@ struct cpuidle_state { · 16 unmodified lines | |||
| 77 | #define CPUIDLE_FLAG_POLLING BIT(0) /* polling state */ | 76 | #define CPUIDLE_FLAG_POLLING BIT(0) /* polling state */ |
| 78 | #define CPUIDLE_FLAG_COUPLED BIT(1) /* state applies to multiple cpus */ | 77 | #define CPUIDLE_FLAG_COUPLED BIT(1) /* state applies to multiple cpus */ |
| 79 | #define CPUIDLE_FLAG_TIMER_STOP BIT(2) /* timer is stopped on this state */ | 78 | #define CPUIDLE_FLAG_TIMER_STOP BIT(2) /* timer is stopped on this state */ |
| 79 | #define CPUIDLE_FLAG_UNUSABLE BIT(3) /* avoid using this state */ | ||
| 80 | 80 | ||
| 81 | struct cpuidle_device_kobj; | 81 | struct cpuidle_device_kobj; |
| 82 | struct cpuidle_state_kobj; | 82 | struct cpuidle_state_kobj; |
| @@ -34,6 +34,8 @@ enum pm_qos_flags_status { · 33 unmodified lines | |||
| 34 | #define PM_QOS_RESUME_LATENCY_NO_CONSTRAINT PM_QOS_LATENCY_ANY | 34 | #define PM_QOS_RESUME_LATENCY_NO_CONSTRAINT PM_QOS_LATENCY_ANY |
| 35 | #define PM_QOS_RESUME_LATENCY_NO_CONSTRAINT_NS PM_QOS_LATENCY_ANY_NS | 35 | #define PM_QOS_RESUME_LATENCY_NO_CONSTRAINT_NS PM_QOS_LATENCY_ANY_NS |
| 36 | #define PM_QOS_LATENCY_TOLERANCE_DEFAULT_VALUE 0 | 36 | #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 | ||
| 37 | #define PM_QOS_LATENCY_TOLERANCE_NO_CONSTRAINT (-1) | 39 | #define PM_QOS_LATENCY_TOLERANCE_NO_CONSTRAINT (-1) |
| 38 | 40 | ||
| 39 | #define PM_QOS_FLAG_NO_POWER_OFF (1 << 0) | 41 | #define PM_QOS_FLAG_NO_POWER_OFF (1 << 0) |
| @@ -49,21 +51,6 @@ struct pm_qos_flags_request { · 9 unmodified lines | |||
| 49 | s32 flags; /* Do not change to 64 bit */ | 51 | s32 flags; /* Do not change to 64 bit */ |
| 50 | }; | 52 | }; |
| 51 | 53 | ||
| 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 | |||
| 67 | enum pm_qos_type { | 54 | enum pm_qos_type { |
| 68 | PM_QOS_UNITIALIZED, | 55 | PM_QOS_UNITIALIZED, |
| 69 | PM_QOS_MAX, /* return the largest value */ | 56 | PM_QOS_MAX, /* return the largest value */ |
| @@ -90,9 +77,51 @@ struct pm_qos_flags { · 20 unmodified lines | |||
| 90 | s32 effective_flags; /* Do not change to 64 bit */ | 77 | s32 effective_flags; /* Do not change to 64 bit */ |
| 91 | }; | 78 | }; |
| 92 | 79 | ||
| 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 | |||
| 93 | struct dev_pm_qos { | 121 | struct dev_pm_qos { |
| 94 | struct pm_qos_constraints resume_latency; | 122 | struct pm_qos_constraints resume_latency; |
| 95 | struct pm_qos_constraints latency_tolerance; | 123 | struct pm_qos_constraints latency_tolerance; |
| 124 | struct freq_constraints freq; | ||
| 96 | struct pm_qos_flags flags; | 125 | struct pm_qos_flags flags; |
| 97 | struct dev_pm_qos_request *resume_latency_req; | 126 | struct dev_pm_qos_request *resume_latency_req; |
| 98 | struct dev_pm_qos_request *latency_tolerance_req; | 127 | 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 | |||
| 191 | switch (type) { | 220 | switch (type) { |
| 192 | case DEV_PM_QOS_RESUME_LATENCY: | 221 | case DEV_PM_QOS_RESUME_LATENCY: |
| 193 | return PM_QOS_RESUME_LATENCY_NO_CONSTRAINT; | 222 | 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; | ||
| 194 | default: | 227 | default: |
| 195 | WARN_ON(1); | 228 | WARN_ON(1); |
| 196 | return 0; | 229 | return 0; |
| @@ -255,27 +288,6 @@ static inline s32 dev_pm_qos_raw_resume_latency(struct device *dev) · 58 unmodified lines | |||
| 255 | } | 288 | } |
| 256 | #endif | 289 | #endif |
| 257 | 290 | ||
| 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 | |||
| 279 | static inline int freq_qos_request_active(struct freq_qos_request *req) | 291 | static inline int freq_qos_request_active(struct freq_qos_request *req) |
| 280 | { | 292 | { |
| 281 | return !IS_ERR_OR_NULL(req->qos); | 293 | return !IS_ERR_OR_NULL(req->qos); |
| @@ -291,6 +303,8 @@ int freq_qos_add_request(struct freq_constraints *qos, · 9 unmodified lines | |||
| 291 | enum freq_qos_req_type type, s32 value); | 303 | enum freq_qos_req_type type, s32 value); |
| 292 | int freq_qos_update_request(struct freq_qos_request *req, s32 new_value); | 304 | int freq_qos_update_request(struct freq_qos_request *req, s32 new_value); |
| 293 | int freq_qos_remove_request(struct freq_qos_request *req); | 305 | 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); | ||
| 294 | 308 | ||
| 295 | int freq_qos_add_notifier(struct freq_constraints *qos, | 309 | int freq_qos_add_notifier(struct freq_constraints *qos, |
| 296 | enum freq_qos_req_type type, | 310 | enum freq_qos_req_type type, |