Skip to content

Commit 8fa79e0

Browse files
committed
Merge branch 'ost' into release
Conflicts: include/acpi/processor.h Signed-off-by: Len Brown <len.brown@intel.com>
2 parents 7458bbd + d81c45e commit 8fa79e0

3 files changed

Lines changed: 53 additions & 8 deletions

File tree

‎drivers/acpi/processor_core.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,7 @@ static void acpi_processor_notify(struct acpi_device *device, u32 event)
722722
switch (event) {
723723
case ACPI_PROCESSOR_NOTIFY_PERFORMANCE:
724724
saved = pr->performance_platform_limit;
725-
acpi_processor_ppc_has_changed(pr);
725+
acpi_processor_ppc_has_changed(pr, 1);
726726
if (saved == pr->performance_platform_limit)
727727
break;
728728
acpi_bus_generate_proc_event(device, event,
@@ -758,7 +758,7 @@ static int acpi_cpu_soft_notify(struct notifier_block *nfb,
758758
struct acpi_processor *pr = per_cpu(processors, cpu);
759759

760760
if (action == CPU_ONLINE && pr) {
761-
acpi_processor_ppc_has_changed(pr);
761+
acpi_processor_ppc_has_changed(pr, 0);
762762
acpi_processor_cst_has_changed(pr);
763763
acpi_processor_tstate_has_changed(pr);
764764
}
@@ -830,7 +830,7 @@ static int __cpuinit acpi_processor_add(struct acpi_device *device)
830830
arch_acpi_processor_cleanup_pdc(pr);
831831

832832
#ifdef CONFIG_CPU_FREQ
833-
acpi_processor_ppc_has_changed(pr);
833+
acpi_processor_ppc_has_changed(pr, 0);
834834
#endif
835835
acpi_processor_get_throttling_info(pr);
836836
acpi_processor_get_limit_info(pr);

‎drivers/acpi/processor_perflib.c‎

Lines changed: 47 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,15 +152,59 @@ static int acpi_processor_get_platform_limit(struct acpi_processor *pr)
152152
return 0;
153153
}
154154

155-
int acpi_processor_ppc_has_changed(struct acpi_processor *pr)
155+
#define ACPI_PROCESSOR_NOTIFY_PERFORMANCE 0x80
156+
/*
157+
* acpi_processor_ppc_ost: Notify firmware the _PPC evaluation status
158+
* @handle: ACPI processor handle
159+
* @status: the status code of _PPC evaluation
160+
* 0: success. OSPM is now using the performance state specificed.
161+
* 1: failure. OSPM has not changed the number of P-states in use
162+
*/
163+
static void acpi_processor_ppc_ost(acpi_handle handle, int status)
164+
{
165+
union acpi_object params[2] = {
166+
{.type = ACPI_TYPE_INTEGER,},
167+
{.type = ACPI_TYPE_INTEGER,},
168+
};
169+
struct acpi_object_list arg_list = {2, params};
170+
acpi_handle temp;
171+
172+
params[0].integer.value = ACPI_PROCESSOR_NOTIFY_PERFORMANCE;
173+
params[1].integer.value = status;
174+
175+
/* when there is no _OST , skip it */
176+
if (ACPI_FAILURE(acpi_get_handle(handle, "_OST", &temp)))
177+
return;
178+
179+
acpi_evaluate_object(handle, "_OST", &arg_list, NULL);
180+
return;
181+
}
182+
183+
int acpi_processor_ppc_has_changed(struct acpi_processor *pr, int event_flag)
156184
{
157185
int ret;
158186

159-
if (ignore_ppc)
187+
if (ignore_ppc) {
188+
/*
189+
* Only when it is notification event, the _OST object
190+
* will be evaluated. Otherwise it is skipped.
191+
*/
192+
if (event_flag)
193+
acpi_processor_ppc_ost(pr->handle, 1);
160194
return 0;
195+
}
161196

162197
ret = acpi_processor_get_platform_limit(pr);
163-
198+
/*
199+
* Only when it is notification event, the _OST object
200+
* will be evaluated. Otherwise it is skipped.
201+
*/
202+
if (event_flag) {
203+
if (ret < 0)
204+
acpi_processor_ppc_ost(pr->handle, 1);
205+
else
206+
acpi_processor_ppc_ost(pr->handle, 0);
207+
}
164208
if (ret < 0)
165209
return (ret);
166210
else

‎include/acpi/processor.h‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ static inline void acpi_processor_ffh_cstate_enter(struct acpi_processor_cx
294294
#ifdef CONFIG_CPU_FREQ
295295
void acpi_processor_ppc_init(void);
296296
void acpi_processor_ppc_exit(void);
297-
int acpi_processor_ppc_has_changed(struct acpi_processor *pr);
297+
int acpi_processor_ppc_has_changed(struct acpi_processor *pr, int event_flag);
298298
extern int acpi_processor_get_bios_limit(int cpu, unsigned int *limit);
299299
#else
300300
static inline void acpi_processor_ppc_init(void)
@@ -305,7 +305,8 @@ static inline void acpi_processor_ppc_exit(void)
305305
{
306306
return;
307307
}
308-
static inline int acpi_processor_ppc_has_changed(struct acpi_processor *pr)
308+
static inline int acpi_processor_ppc_has_changed(struct acpi_processor *pr,
309+
int event_flag)
309310
{
310311
static unsigned int printout = 1;
311312
if (printout) {

0 commit comments

Comments
 (0)