Skip to content

Commit bde7f15

Browse files
committed
Merge tag 'pm-6.5-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull power management fixes from Rafael Wysocki: "These fix hibernation (after recent changes), frequency QoS and the sparc cpufreq driver. Specifics: - Unbreak the /sys/power/resume interface after recent changes (Azat Khuzhin). - Allow PM_QOS_DEFAULT_VALUE to be used with frequency QoS (Chungkai Yang). - Remove __init from cpufreq callbacks in the sparc driver, because they may be called after initialization too (Viresh Kumar)" * tag 'pm-6.5-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: cpufreq: sparc: Don't mark cpufreq callbacks with __init PM: QoS: Restore support for default value on frequency QoS PM: hibernate: Fix writing maj:min to /sys/power/resume
2 parents 3a97a29 + d121758 commit bde7f15

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

drivers/cpufreq/sparc-us2e-cpufreq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ static int us2e_freq_target(struct cpufreq_policy *policy, unsigned int index)
269269
return smp_call_function_single(cpu, __us2e_freq_target, &index, 1);
270270
}
271271

272-
static int __init us2e_freq_cpu_init(struct cpufreq_policy *policy)
272+
static int us2e_freq_cpu_init(struct cpufreq_policy *policy)
273273
{
274274
unsigned int cpu = policy->cpu;
275275
unsigned long clock_tick = sparc64_get_clock_tick(cpu) / 1000;

drivers/cpufreq/sparc-us3-cpufreq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ static int us3_freq_target(struct cpufreq_policy *policy, unsigned int index)
117117
return smp_call_function_single(cpu, update_safari_cfg, &new_bits, 1);
118118
}
119119

120-
static int __init us3_freq_cpu_init(struct cpufreq_policy *policy)
120+
static int us3_freq_cpu_init(struct cpufreq_policy *policy)
121121
{
122122
unsigned int cpu = policy->cpu;
123123
unsigned long clock_tick = sparc64_get_clock_tick(cpu) / 1000;

kernel/power/hibernate.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1179,6 +1179,7 @@ static ssize_t resume_store(struct kobject *kobj, struct kobj_attribute *attr,
11791179
unsigned maj, min, offset;
11801180
char *p, dummy;
11811181

1182+
error = 0;
11821183
if (sscanf(name, "%u:%u%c", &maj, &min, &dummy) == 2 ||
11831184
sscanf(name, "%u:%u:%u:%c", &maj, &min, &offset,
11841185
&dummy) == 3) {

kernel/power/qos.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,11 @@ late_initcall(cpu_latency_qos_init);
426426

427427
/* Definitions related to the frequency QoS below. */
428428

429+
static inline bool freq_qos_value_invalid(s32 value)
430+
{
431+
return value < 0 && value != PM_QOS_DEFAULT_VALUE;
432+
}
433+
429434
/**
430435
* freq_constraints_init - Initialize frequency QoS constraints.
431436
* @qos: Frequency QoS constraints to initialize.
@@ -531,7 +536,7 @@ int freq_qos_add_request(struct freq_constraints *qos,
531536
{
532537
int ret;
533538

534-
if (IS_ERR_OR_NULL(qos) || !req || value < 0)
539+
if (IS_ERR_OR_NULL(qos) || !req || freq_qos_value_invalid(value))
535540
return -EINVAL;
536541

537542
if (WARN(freq_qos_request_active(req),
@@ -563,7 +568,7 @@ EXPORT_SYMBOL_GPL(freq_qos_add_request);
563568
*/
564569
int freq_qos_update_request(struct freq_qos_request *req, s32 new_value)
565570
{
566-
if (!req || new_value < 0)
571+
if (!req || freq_qos_value_invalid(new_value))
567572
return -EINVAL;
568573

569574
if (WARN(!freq_qos_request_active(req),

0 commit comments

Comments
 (0)