From: Luming Yu <luyu@redhat.com> Date: Thu, 26 Mar 2009 12:58:17 +0800 Subject: [acpi] add T-state notification support Message-id: 49CB0B69.6070507@redhat.com O-Subject: [RHEL 5.4 PATCH] bz487567 : Add T-state notification support Bugzilla: 487567 RH-Acked-by: Peter Martuccelli <peterm@redhat.com> RH-Acked-by: Prarit Bhargava <prarit@redhat.com> Description of problem: Currently RHEL 5.x does not have T-state notification support and there is a separate regression bug for P-state notification support. T-state (TPC/TSS/PTC) support was put into the 2.6.23 kernel. OSPM driver is not handling correctly two ACPI notifications from Processor Device objects: Performance Present Capabilities Changed (0x80) and Throttling Present Capabilities Changed (0x82). According to ACPI 3.0b after receiving the 0x80 notification, OSPM driver must get the new number of P-states by executing _PPC object and must change the current P-state accordingly. Similarly when 0x82 notification is generated by the platform, OSPM driver must get the new number of T-states by executing _TPC object and must change the current T-state accordingly. Testing status: We are doing testing at Intel, but so far initial test results have been very promising. Brew info: http://brewweb.devel.redhat.com/brew/taskinfo?taskID=1739017 Please review, test, and ACK. Thanks, Luming diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c index 6b206e2..85ec262 100644 --- a/drivers/acpi/processor_core.c +++ b/drivers/acpi/processor_core.c @@ -67,6 +67,7 @@ #define ACPI_PROCESSOR_FILE_LIMIT "limit" #define ACPI_PROCESSOR_NOTIFY_PERFORMANCE 0x80 #define ACPI_PROCESSOR_NOTIFY_POWER 0x81 +#define ACPI_PROCESSOR_NOTIFY_THROTTLING 0x82 #define ACPI_PROCESSOR_LIMIT_USER 0 #define ACPI_PROCESSOR_LIMIT_THERMAL 1 @@ -595,6 +596,9 @@ static void acpi_processor_notify(acpi_handle handle, u32 event, void *data) acpi_processor_cst_has_changed(pr); acpi_bus_generate_event(device, event, 0); break; + case ACPI_PROCESSOR_NOTIFY_THROTTLING: + acpi_processor_tstate_has_changed(pr); + acpi_bus_generate_event(device, event, 0); default: ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Unsupported event [0x%x]\n", event)); diff --git a/include/acpi/processor.h b/include/acpi/processor.h index db4bfd9..7c219b6 100644 --- a/include/acpi/processor.h +++ b/include/acpi/processor.h @@ -289,6 +289,7 @@ static inline int acpi_processor_ppc_has_changed(struct acpi_processor *pr) #endif /* CONFIG_CPU_FREQ */ /* in processor_throttling.c */ +int acpi_processor_tstate_has_changed(struct acpi_processor *pr); int acpi_processor_get_throttling_info(struct acpi_processor *pr); int acpi_processor_set_throttling(struct acpi_processor *pr, int state); extern struct file_operations acpi_processor_throttling_fops;