Skip to content

Commit a1031ef

Browse files
committed
Merge remote-tracking branch 'linux-pm/linux-next' into sound/upstream-20250821
2 parents 907b311 + f0f47de commit a1031ef

11 files changed

Lines changed: 106 additions & 67 deletions

File tree

drivers/acpi/apei/einj-core.c

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ static void __iomem *einj_get_parameter_address(void)
315315
memcpy_fromio(&v5param, p, v5param_size);
316316
acpi5 = 1;
317317
check_vendor_extension(pa_v5, &v5param);
318-
if (available_error_type & ACPI65_EINJV2_SUPP) {
318+
if (is_v2 && available_error_type & ACPI65_EINJV2_SUPP) {
319319
len = v5param.einjv2_struct.length;
320320
offset = offsetof(struct einjv2_extension_struct, component_arr);
321321
max_nr_components = (len - offset) /
@@ -540,6 +540,9 @@ static int __einj_error_inject(u32 type, u32 flags, u64 param1, u64 param2,
540540
struct set_error_type_with_address *v5param;
541541

542542
v5param = kmalloc(v5param_size, GFP_KERNEL);
543+
if (!v5param)
544+
return -ENOMEM;
545+
543546
memcpy_fromio(v5param, einj_param, v5param_size);
544547
v5param->type = type;
545548
if (type & ACPI5_VENDOR_BIT) {
@@ -1091,7 +1094,7 @@ static int __init einj_probe(struct faux_device *fdev)
10911094
return rc;
10921095
}
10931096

1094-
static void __exit einj_remove(struct faux_device *fdev)
1097+
static void einj_remove(struct faux_device *fdev)
10951098
{
10961099
struct apei_exec_context ctx;
10971100

@@ -1114,15 +1117,9 @@ static void __exit einj_remove(struct faux_device *fdev)
11141117
}
11151118

11161119
static struct faux_device *einj_dev;
1117-
/*
1118-
* einj_remove() lives in .exit.text. For drivers registered via
1119-
* platform_driver_probe() this is ok because they cannot get unbound at
1120-
* runtime. So mark the driver struct with __refdata to prevent modpost
1121-
* triggering a section mismatch warning.
1122-
*/
1123-
static struct faux_device_ops einj_device_ops __refdata = {
1120+
static struct faux_device_ops einj_device_ops = {
11241121
.probe = einj_probe,
1125-
.remove = __exit_p(einj_remove),
1122+
.remove = einj_remove,
11261123
};
11271124

11281125
static int __init einj_init(void)

drivers/acpi/pfr_update.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ static bool applicable_image(const void *data, struct pfru_update_cap_info *cap,
329329
if (type == PFRU_CODE_INJECT_TYPE)
330330
return payload_hdr->rt_ver >= cap->code_rt_version;
331331

332-
return payload_hdr->rt_ver >= cap->drv_rt_version;
332+
return payload_hdr->svn_ver >= cap->drv_svn;
333333
}
334334

335335
static void print_update_debug_info(struct pfru_updated_result *result,

drivers/cpufreq/cpufreq.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1121,7 +1121,8 @@ static int cpufreq_init_policy(struct cpufreq_policy *policy)
11211121

11221122
if (has_target()) {
11231123
/* Update policy governor to the one used before hotplug. */
1124-
gov = get_governor(policy->last_governor);
1124+
if (policy->last_governor[0] != '\0')
1125+
gov = get_governor(policy->last_governor);
11251126
if (gov) {
11261127
pr_debug("Restoring governor %s for cpu %d\n",
11271128
gov->name, policy->cpu);

drivers/cpuidle/governors/menu.c

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -287,20 +287,15 @@ static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev,
287287
return 0;
288288
}
289289

290-
if (tick_nohz_tick_stopped()) {
291-
/*
292-
* If the tick is already stopped, the cost of possible short
293-
* idle duration misprediction is much higher, because the CPU
294-
* may be stuck in a shallow idle state for a long time as a
295-
* result of it. In that case say we might mispredict and use
296-
* the known time till the closest timer event for the idle
297-
* state selection.
298-
*/
299-
if (predicted_ns < TICK_NSEC)
300-
predicted_ns = data->next_timer_ns;
301-
} else if (latency_req > predicted_ns) {
302-
latency_req = predicted_ns;
303-
}
290+
/*
291+
* If the tick is already stopped, the cost of possible short idle
292+
* duration misprediction is much higher, because the CPU may be stuck
293+
* in a shallow idle state for a long time as a result of it. In that
294+
* case, say we might mispredict and use the known time till the closest
295+
* timer event for the idle state selection.
296+
*/
297+
if (tick_nohz_tick_stopped() && predicted_ns < TICK_NSEC)
298+
predicted_ns = data->next_timer_ns;
304299

305300
/*
306301
* Find the idle state with the lowest power while satisfying
@@ -316,13 +311,15 @@ static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev,
316311
if (idx == -1)
317312
idx = i; /* first enabled state */
318313

314+
if (s->exit_latency_ns > latency_req)
315+
break;
316+
319317
if (s->target_residency_ns > predicted_ns) {
320318
/*
321319
* Use a physical idle state, not busy polling, unless
322320
* a timer is going to trigger soon enough.
323321
*/
324322
if ((drv->states[idx].flags & CPUIDLE_FLAG_POLLING) &&
325-
s->exit_latency_ns <= latency_req &&
326323
s->target_residency_ns <= data->next_timer_ns) {
327324
predicted_ns = s->target_residency_ns;
328325
idx = i;
@@ -354,8 +351,6 @@ static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev,
354351

355352
return idx;
356353
}
357-
if (s->exit_latency_ns > latency_req)
358-
break;
359354

360355
idx = i;
361356
}

drivers/thermal/intel/int340x_thermal/acpi_thermal_rel.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,9 +220,6 @@ static int acpi_parse_psvt(acpi_handle handle, int *psvt_count, struct psvt **ps
220220
int i, result = 0;
221221
struct psvt *psvts;
222222

223-
if (!acpi_has_method(handle, "PSVT"))
224-
return -ENODEV;
225-
226223
status = acpi_evaluate_object(handle, "PSVT", NULL, &buffer);
227224
if (ACPI_FAILURE(status))
228225
return -ENODEV;

include/uapi/linux/pfrut.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ struct pfru_payload_hdr {
8989
__u32 hw_ver;
9090
__u32 rt_ver;
9191
__u8 platform_id[16];
92+
__u32 svn_ver;
9293
};
9394

9495
enum pfru_dsm_status {

tools/power/cpupower/man/cpupower-set.1

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,11 @@ Refer to the AMD P-State kernel documentation for further information.
8181
.RE
8282

8383
.PP
84-
\-\-turbo\-boost, \-t
84+
\-\-turbo\-boost, \-\-boost, \-t
8585
.RS 4
86-
This option is used to enable or disable the turbo boost feature on
87-
supported Intel and AMD processors.
86+
This option is used to enable or disable the boost feature on
87+
supported Intel and AMD processors, and other boost supported systems.
88+
(The --boost option is an alias for the --turbo-boost option)
8889

8990
This option takes as parameter either \fB1\fP to enable, or \fB0\fP to disable the feature.
9091

tools/power/cpupower/utils/cpufreq-info.c

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ static int get_boost_mode_x86(unsigned int cpu)
128128
/* ToDo: Make this more global */
129129
unsigned long pstates[MAX_HW_PSTATES] = {0,};
130130

131-
ret = cpufreq_has_boost_support(cpu, &support, &active, &b_states);
131+
ret = cpufreq_has_x86_boost_support(cpu, &support, &active, &b_states);
132132
if (ret) {
133133
printf(_("Error while evaluating Boost Capabilities"
134134
" on CPU %d -- are you root?\n"), cpu);
@@ -204,6 +204,18 @@ static int get_boost_mode_x86(unsigned int cpu)
204204
return 0;
205205
}
206206

207+
static int get_boost_mode_generic(unsigned int cpu)
208+
{
209+
bool active;
210+
211+
if (!cpufreq_has_generic_boost_support(&active)) {
212+
printf(_(" boost state support:\n"));
213+
printf(_(" Active: %s\n"), active ? _("yes") : _("no"));
214+
}
215+
216+
return 0;
217+
}
218+
207219
/* --boost / -b */
208220

209221
static int get_boost_mode(unsigned int cpu)
@@ -214,6 +226,8 @@ static int get_boost_mode(unsigned int cpu)
214226
cpupower_cpu_info.vendor == X86_VENDOR_HYGON ||
215227
cpupower_cpu_info.vendor == X86_VENDOR_INTEL)
216228
return get_boost_mode_x86(cpu);
229+
else
230+
get_boost_mode_generic(cpu);
217231

218232
freqs = cpufreq_get_boost_frequencies(cpu);
219233
if (freqs) {

tools/power/cpupower/utils/cpupower-set.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ static struct option set_opts[] = {
2121
{"epp", required_argument, NULL, 'e'},
2222
{"amd-pstate-mode", required_argument, NULL, 'm'},
2323
{"turbo-boost", required_argument, NULL, 't'},
24+
{"boost", required_argument, NULL, 't'},
2425
{ },
2526
};
2627

@@ -62,8 +63,8 @@ int cmd_set(int argc, char **argv)
6263

6364
params.params = 0;
6465
/* parameter parsing */
65-
while ((ret = getopt_long(argc, argv, "b:e:m:",
66-
set_opts, NULL)) != -1) {
66+
while ((ret = getopt_long(argc, argv, "b:e:m:t:",
67+
set_opts, NULL)) != -1) {
6768
switch (ret) {
6869
case 'b':
6970
if (params.perf_bias)

tools/power/cpupower/utils/helpers/helpers.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,9 @@ extern struct cpupower_cpu_info cpupower_cpu_info;
103103

104104
/* cpuid and cpuinfo helpers **************************/
105105

106+
int cpufreq_has_generic_boost_support(bool *active);
107+
int cpupower_set_turbo_boost(int turbo_boost);
108+
106109
/* X86 ONLY ****************************************/
107110
#if defined(__i386__) || defined(__x86_64__)
108111

@@ -118,7 +121,6 @@ extern unsigned long long msr_intel_get_turbo_ratio(unsigned int cpu);
118121

119122
extern int cpupower_set_epp(unsigned int cpu, char *epp);
120123
extern int cpupower_set_amd_pstate_mode(char *mode);
121-
extern int cpupower_set_turbo_boost(int turbo_boost);
122124

123125
/* Read/Write msr ****************************/
124126

@@ -139,8 +141,8 @@ extern int decode_pstates(unsigned int cpu, int boost_states,
139141

140142
/* AMD HW pstate decoding **************************/
141143

142-
extern int cpufreq_has_boost_support(unsigned int cpu, int *support,
143-
int *active, int * states);
144+
int cpufreq_has_x86_boost_support(unsigned int cpu, int *support,
145+
int *active, int *states);
144146

145147
/* AMD P-State stuff **************************/
146148
bool cpupower_amd_pstate_enabled(void);
@@ -181,13 +183,11 @@ static inline int cpupower_set_epp(unsigned int cpu, char *epp)
181183
{ return -1; };
182184
static inline int cpupower_set_amd_pstate_mode(char *mode)
183185
{ return -1; };
184-
static inline int cpupower_set_turbo_boost(int turbo_boost)
185-
{ return -1; };
186186

187187
/* Read/Write msr ****************************/
188188

189-
static inline int cpufreq_has_boost_support(unsigned int cpu, int *support,
190-
int *active, int * states)
189+
static inline int cpufreq_has_x86_boost_support(unsigned int cpu, int *support,
190+
int *active, int *states)
191191
{ return -1; }
192192

193193
static inline bool cpupower_amd_pstate_enabled(void)

0 commit comments

Comments
 (0)