ACPI processor _HID cleanups
Subsystems (2)
cover ACPI processor _HID cleanups
---
Bjorn Helgaas (3):
ACPI: processor: move device _HID into driver
ACPI: processor: check for synthetic _HID, default to "Device" declaration
ACPI: use LNXCPU, not ACPI_CPU, for Linux-specific processor _HID
drivers/acpi/processor_core.c | 32 ++++++++++++++++---------------- include/acpi/acpi_drivers.h | 3 +-- 2 files changed, 17 insertions(+), 18 deletions(-)
PATCH 1/3 ACPI: use LNXCPU, not ACPI_CPU, for Linux-specific processor _HID
ACPI_PROCESSOR_OBJECT_HID is a synthetic _HID that Linux generates for "Processor" definitions. Unlike "Device" definitions, "Processor" definitions do not have a _HID in the namespace, so we generate a fake _HID. By convention, all these fake _HIDs begin with "LNX".
This does change the user-visible _HID for "Processor" objects -- previously, we used "ACPI_CPU" and this changes that to "LNXCPU", which starts with "LNX" as do all the other made-up _HIDs. This change is visible in processor filenames and "hid" files under /sys/devices/LNXSYSTM:00/.
--- include/acpi/acpi_drivers.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
include/acpi/acpi_drivers.h +1 -1
@@ -57,7 +57,7 @@*/ #define ACPI_POWER_HID "LNXPOWER" -#define ACPI_PROCESSOR_OBJECT_HID "ACPI_CPU" +#define ACPI_PROCESSOR_OBJECT_HID "LNXCPU"#define ACPI_PROCESSOR_HID "ACPI0007"#define ACPI_SYSTEM_HID "LNXSYSTM"#define ACPI_THERMAL_HID "LNXTHERM"
PATCH 2/3 ACPI: processor: check for synthetic _HID, default to "Device" declaration
In reply to Bjorn HelgaasThis patch inverts the logic that distinguishes "Processor" statements from "Device" statements, so we now check explicitly for "Processor" and default to "Device". This removes the only real use of ACPI_PROCESSOR_HID, so we can then remove the #define. It also has the theoretical advantage that if a new processor _HID were ever added, we wouldn't have to change the code here.
--- drivers/acpi/processor_core.c | 30 +++++++++++++++--------------- 1 files changed, 15 insertions(+), 15 deletions(-)
drivers/acpi/processor_core.c +15 -15
@@ -596,7 +596,21 @@ static int acpi_processor_get_info(struct acpi_device *device)ACPI_DEBUG_PRINT ((ACPI_DB_INFO ,"No bus mastering arbitration control\n" )); -if (!strcmp (acpi_device_hid (device),ACPI_PROCESSOR_HID )) { +if (!strcmp (acpi_device_hid (device),ACPI_PROCESSOR_OBJECT_HID )) { +/* Declared with "Processor" statement; match ProcessorID */ + status =acpi_evaluate_object (pr->handle,NULL ,NULL , &buffer); +if (ACPI_FAILURE (status)) { + printk(KERN_ERR PREFIX "Evaluating processor object\n"); +return -ENODEV ; + } + +/* +* TBD: Synch processor ID (via LAPIC/LSAPIC structures) on SMP. +* >>> 'acpi_get_processor_id(acpi_id, &id)' in +* arch/xxx/acpi.c +*/ + pr->acpi_id = object.processor.proc_id; + }else {/* * Declared with "Device" statement; match _UID. * Note that we don't handle string _UIDs yet.
@@ -611,20 +625,6 @@ static int acpi_processor_get_info(struct acpi_device *device) } device_declaration =1 ; pr->acpi_id = value; - }else { -/* Declared with "Processor" statement; match ProcessorID */ - status =acpi_evaluate_object (pr->handle,NULL ,NULL , &buffer); -if (ACPI_FAILURE (status)) { - printk(KERN_ERR PREFIX "Evaluating processor object\n"); -return -ENODEV ; - } - -/* -* TBD: Synch processor ID (via LAPIC/LSAPIC structures) on SMP. -* >>> 'acpi_get_processor_id(acpi_id, &id)' in -* arch/xxx/acpi.c -*/ - pr->acpi_id = object.processor.proc_id; } cpu_index =get_cpu_id (pr->handle, device_declaration, pr->acpi_id);
PATCH 3/3 ACPI: processor: move device _HID into driver
In reply to Bjorn HelgaasThe ACPI0007 _HID used for processor "Device" objects in the namespace is not needed outside the processor driver, so move it there. Also, the #define is only used once, so just remove it and hard-code "ACPI0007".
--- drivers/acpi/processor_core.c | 2 +- include/acpi/acpi_drivers.h | 1 - 2 files changed, 1 insertions(+), 2 deletions(-)
drivers/acpi/processor_core.c +1 -1
@@ -89,7 +89,7 @@ static int acpi_processor_handle_eject(struct acpi_processor *pr);static const struct acpi_device_id processor_device_ids[] = { {ACPI_PROCESSOR_OBJECT_HID ,0 }, - {ACPI_PROCESSOR_HID ,0 }, + {"ACPI0007" ,0 }, {"" ,0 }, };MODULE_DEVICE_TABLE (acpi, processor_device_ids);
include/acpi/acpi_drivers.h +0 -1
@@ -58,7 +58,6 @@#define ACPI_POWER_HID "LNXPOWER"#define ACPI_PROCESSOR_OBJECT_HID "LNXCPU" -#define ACPI_PROCESSOR_HID "ACPI0007"#define ACPI_SYSTEM_HID "LNXSYSTM"#define ACPI_THERMAL_HID "LNXTHERM"#define ACPI_BUTTON_HID_POWERF "LNXPWRBN"
applied
thanks,
Len Brown, Intel Open Source Technology Center
Quoted 16 lines · Bjorn Helgaas
---
Bjorn Helgaas (3):
ACPI: processor: move device_HIDinto driver
ACPI: processor: check for synthetic_HID, default to "Device" declaration
ACPI: use LNXCPU, notACPI_CPU, for Linux-specific processor_HIDdrivers/acpi/processor_core.c | 32 ++++++++++++++++---------------- include/acpi/acpi_drivers.h | 3 +-- 2 files changed, 17 insertions(+), 18 deletions(-)--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html