Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 117478c

Browse files
Wer-Wolfrafaeljw
authored andcommitted
ACPI: acpi_pad: Still evaluate _OST when _PUR evaluation fails
The ACPI specification says that if no action was performed when processing the _PUR object, _OST should still be evaluated, albeit with a different status code. Evaluate _OST even when evaluating _PUR fails, to signal the firmware that no action was performed. Compile-tested only. Signed-off-by: Armin Wolf <W_Armin@gmx.de> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 83a7eef commit 117478c

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

drivers/acpi/acpi_pad.c

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@
2525
#define ACPI_PROCESSOR_AGGREGATOR_CLASS "acpi_pad"
2626
#define ACPI_PROCESSOR_AGGREGATOR_DEVICE_NAME "Processor Aggregator"
2727
#define ACPI_PROCESSOR_AGGREGATOR_NOTIFY 0x80
28+
29+
#define ACPI_PROCESSOR_AGGREGATOR_STATUS_SUCCESS 0
30+
#define ACPI_PROCESSOR_AGGREGATOR_STATUS_NO_ACTION 1
31+
2832
static DEFINE_MUTEX(isolated_cpus_lock);
2933
static DEFINE_MUTEX(round_robin_lock);
3034

@@ -382,16 +386,23 @@ static void acpi_pad_handle_notify(acpi_handle handle)
382386
.length = 4,
383387
.pointer = (void *)&idle_cpus,
384388
};
389+
u32 status;
385390

386391
mutex_lock(&isolated_cpus_lock);
387392
num_cpus = acpi_pad_pur(handle);
388393
if (num_cpus < 0) {
389-
mutex_unlock(&isolated_cpus_lock);
390-
return;
394+
/* The ACPI specification says that if no action was performed when
395+
* processing the _PUR object, _OST should still be evaluated, albeit
396+
* with a different status code.
397+
*/
398+
status = ACPI_PROCESSOR_AGGREGATOR_STATUS_NO_ACTION;
399+
} else {
400+
status = ACPI_PROCESSOR_AGGREGATOR_STATUS_SUCCESS;
401+
acpi_pad_idle_cpus(num_cpus);
391402
}
392-
acpi_pad_idle_cpus(num_cpus);
403+
393404
idle_cpus = acpi_pad_idle_cpus_num();
394-
acpi_evaluate_ost(handle, ACPI_PROCESSOR_AGGREGATOR_NOTIFY, 0, &param);
405+
acpi_evaluate_ost(handle, ACPI_PROCESSOR_AGGREGATOR_NOTIFY, status, &param);
395406
mutex_unlock(&isolated_cpus_lock);
396407
}
397408

0 commit comments

Comments
 (0)