Linux ACPI
 help / color / mirror / Atom feed
* [PATCH 0/3] ACPI processor _HID cleanups
@ 2009-04-27 22:33 Bjorn Helgaas
  2009-04-27 22:33 ` [PATCH 1/3] ACPI: use LNXCPU, not ACPI_CPU, for Linux-specific processor _HID Bjorn Helgaas
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Bjorn Helgaas @ 2009-04-27 22:33 UTC (permalink / raw)
  To: Len Brown; +Cc: linux-acpi

---

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(-)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/3] ACPI: use LNXCPU, not ACPI_CPU, for Linux-specific processor _HID
  2009-04-27 22:33 [PATCH 0/3] ACPI processor _HID cleanups Bjorn Helgaas
@ 2009-04-27 22:33 ` Bjorn Helgaas
  2009-04-27 22:33 ` [PATCH 2/3] ACPI: processor: check for synthetic _HID, default to "Device" declaration Bjorn Helgaas
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Bjorn Helgaas @ 2009-04-27 22:33 UTC (permalink / raw)
  To: Len Brown; +Cc: linux-acpi

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/.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
---
 include/acpi/acpi_drivers.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/acpi/acpi_drivers.h b/include/acpi/acpi_drivers.h
index 0352c8f..c9922b3 100644
--- a/include/acpi/acpi_drivers.h
+++ b/include/acpi/acpi_drivers.h
@@ -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"


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/3] ACPI: processor: check for synthetic _HID, default to "Device" declaration
  2009-04-27 22:33 [PATCH 0/3] ACPI processor _HID cleanups Bjorn Helgaas
  2009-04-27 22:33 ` [PATCH 1/3] ACPI: use LNXCPU, not ACPI_CPU, for Linux-specific processor _HID Bjorn Helgaas
@ 2009-04-27 22:33 ` Bjorn Helgaas
  2009-04-27 22:33 ` [PATCH 3/3] ACPI: processor: move device _HID into driver Bjorn Helgaas
  2009-05-28  1:14 ` [PATCH 0/3] ACPI processor _HID cleanups Len Brown
  3 siblings, 0 replies; 5+ messages in thread
From: Bjorn Helgaas @ 2009-04-27 22:33 UTC (permalink / raw)
  To: Len Brown; +Cc: linux-acpi

This 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.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
---
 drivers/acpi/processor_core.c |   30 +++++++++++++++---------------
 1 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c
index 45ad328..cf627d6 100644
--- a/drivers/acpi/processor_core.c
+++ b/drivers/acpi/processor_core.c
@@ -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);
 


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 3/3] ACPI: processor: move device _HID into driver
  2009-04-27 22:33 [PATCH 0/3] ACPI processor _HID cleanups Bjorn Helgaas
  2009-04-27 22:33 ` [PATCH 1/3] ACPI: use LNXCPU, not ACPI_CPU, for Linux-specific processor _HID Bjorn Helgaas
  2009-04-27 22:33 ` [PATCH 2/3] ACPI: processor: check for synthetic _HID, default to "Device" declaration Bjorn Helgaas
@ 2009-04-27 22:33 ` Bjorn Helgaas
  2009-05-28  1:14 ` [PATCH 0/3] ACPI processor _HID cleanups Len Brown
  3 siblings, 0 replies; 5+ messages in thread
From: Bjorn Helgaas @ 2009-04-27 22:33 UTC (permalink / raw)
  To: Len Brown; +Cc: linux-acpi

The 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".

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
---
 drivers/acpi/processor_core.c |    2 +-
 include/acpi/acpi_drivers.h   |    1 -
 2 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c
index cf627d6..cabff4c 100644
--- a/drivers/acpi/processor_core.c
+++ b/drivers/acpi/processor_core.c
@@ -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);
diff --git a/include/acpi/acpi_drivers.h b/include/acpi/acpi_drivers.h
index c9922b3..5e8ed3a 100644
--- a/include/acpi/acpi_drivers.h
+++ b/include/acpi/acpi_drivers.h
@@ -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"


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 0/3] ACPI processor _HID cleanups
  2009-04-27 22:33 [PATCH 0/3] ACPI processor _HID cleanups Bjorn Helgaas
                   ` (2 preceding siblings ...)
  2009-04-27 22:33 ` [PATCH 3/3] ACPI: processor: move device _HID into driver Bjorn Helgaas
@ 2009-05-28  1:14 ` Len Brown
  3 siblings, 0 replies; 5+ messages in thread
From: Len Brown @ 2009-05-28  1:14 UTC (permalink / raw)
  To: Bjorn Helgaas; +Cc: linux-acpi

applied

thanks,
Len Brown, Intel Open Source Technology Center

On Mon, 27 Apr 2009, Bjorn Helgaas wrote:

> ---
> 
> 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(-)
> --
> To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-05-28  1:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-27 22:33 [PATCH 0/3] ACPI processor _HID cleanups Bjorn Helgaas
2009-04-27 22:33 ` [PATCH 1/3] ACPI: use LNXCPU, not ACPI_CPU, for Linux-specific processor _HID Bjorn Helgaas
2009-04-27 22:33 ` [PATCH 2/3] ACPI: processor: check for synthetic _HID, default to "Device" declaration Bjorn Helgaas
2009-04-27 22:33 ` [PATCH 3/3] ACPI: processor: move device _HID into driver Bjorn Helgaas
2009-05-28  1:14 ` [PATCH 0/3] ACPI processor _HID cleanups Len Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox